Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
109
rated 0 times [  109] [ 0]  / answers: 1 / hits: 93524  / 2 Years ago, fri, november 4, 2022, 1:15:00

I've set up SSL on my webserver, now I need two files:




  • a certificate

  • a certificate Key



How do I create a self-signed certificate for testing purposes?


More From » server

 Answers
0

Ubuntu, even the 'minimal' flavour, comes with the ssl-cert package pre-installed, which means you don't need to do anything.



The files you're looking for are already on your system:



/etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/ssl/private/ssl-cert-snakeoil.key





Advanced:



If for some reason you need to create a fresh certificate, you can run



sudo make-ssl-cert generate-default-snakeoil --force-overwrite 


If you want to change the expiration date of you certificate, you can manipulate the make-ssl-cert script at /usr/sbin/make-ssl-cert. Around like 124 there's a line similar to this:



openssl req -config $TMPFILE -new -x509 -nodes  


Where you can change the expiration date by adding the -days argument:



openssl req -config $TMPFILE -new -days 365 -x509 -nodes  


More options can be found in the manual page of req.


[#44586] Saturday, November 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
looweets

Total Points: 52
Total Questions: 114
Total Answers: 111

Location: Turkmenistan
Member since Sat, Apr 16, 2022
2 Years ago
;