How to create a self-signed SSL certificate?


Stefano Palazzo

I have set up SSL on the webserver and now need two files:

  • Certificate
  • certificate key

How to create a self-signed certificate for testing purposes?

Stefano Palazzo

Ubuntu, even the "minimal" flavor, comes with ssl-certpackages pre-installed, which means you don't have to do anything.

The file you are looking for is 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 new certificate, you can run

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

If you want to change the expiration date of the certificate, you can manipulate the make-ssl-cert script /usr/sbin/make-ssl-certat . Like 124 or so there is a line similar to:

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

There you can add a -daysparameter to change the expiration date :

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

More options can be found in the man page ofreq .

Related


How to create a self-signed SSL certificate?

Stefano Palazzo I have set up SSL on the webserver and now need two files: Certificate certificate key How to create a self-signed certificate for testing purposes? Stefano Palazzo Ubuntu, even the "minimal" flavor, comes with ssl-certpackages pre-installed, w

How to create a self-signed SSL certificate?

Stefano Palazzo I have set up SSL on the webserver and now need two files: Certificate certificate key How to create a self-signed certificate for testing purposes? Stefano Palazzo Ubuntu, even the "minimal" flavor, comes with ssl-certpackages pre-installed, w

How to create a self-signed certificate with OpenSSL

Michelle Macon I am adding HTTPS support to an embedded Linux device. I try to generate self signed certificate by following steps: openssl req -new > cert.csr openssl rsa -in privkey.pem -out key.pem openssl x509 -in cert.csr -out cert.pem -req -signkey key.p

How to create a self-signed certificate with OpenSSL

Michelle Macon I am adding HTTPS support to an embedded Linux device. I try to generate self signed certificate by following steps: openssl req -new > cert.csr openssl rsa -in privkey.pem -out key.pem openssl x509 -in cert.csr -out cert.pem -req -signkey key.p

How to create a self-signed certificate with OpenSSL

Michelle Macon I am adding HTTPS support to an embedded Linux device. I try to generate self signed certificate by following steps: openssl req -new > cert.csr openssl rsa -in privkey.pem -out key.pem openssl x509 -in cert.csr -out cert.pem -req -signkey key.p

Create SSL-Socket with self-signed certificate on Android

spaghetti I'm trying to connect an Android app to an SSL-enabled server using a self-signed certificate. I've read dozens of tutorials and the app is now accepting the certificate and connecting to the server, but I don't receive any data anymore. The original

Create SSL-Socket with self-signed certificate on Android

spaghetti I'm trying to connect an Android app to an SSL-enabled server using a self-signed certificate. I've read dozens of tutorials and the app is now accepting the certificate and connecting to the server, but I don't receive any data anymore. The original

Ansible: Create self-signed SSL certificate and key

tom I want to create a self signed certificate to use with stunnel to securely tunnel my redis communication between redis server and client. I am using this command to generate a certificate and it is working fine. openssl req -x509 -nodes -days 3650 -newkey

SSL - Self Signed Certificate with Wildcard

Niek Vandael I created a certificate with CN: *.hostname Chome and IE complain about this certificate when I navigate to dev.hostname or tst.hostname: Error in Chrome: NET::ERR_CERT_COMMON_NAME_INVALID Yes, I have added the certificate to Trusted Root CAs. Sho

SSL - Self Signed Certificate with Wildcard

Niek Vandael I created a certificate with CN: *.hostname Chome and IE complain about this certificate when I navigate to dev.hostname or tst.hostname: Error in Chrome: NET::ERR_CERT_COMMON_NAME_INVALID Yes, I have added the certificate to Trusted Root CAs. Sho

How to avoid browser warnings when self-signed SSL certificate?

Stephan Ahlf I plan to deploy my own hardware device in the form of a RaspberryPi running a NodeJs server, which should include HTTPS communication. It is intended to run as an intranet device and will always be named with the same computer name (or the same I

How to perform SSL with self-signed certificate using WinHTTP

columnar I seem to have a problem with this, and in the spirit of a generic question that can be referenced by others, I'm looking for a good example of using SSL. More specifically, I get error 0x00002F8F from WinHttpSendRequest, which is ERROR_INTERNET_DECOD

How to avoid browser warnings when self-signed SSL certificate?

Stephan Ahlf I plan to deploy my own hardware device in the form of a RaspberryPi running a NodeJs server, which should include HTTPS communication. It is intended to run as an intranet device and will always be named with the same computer name (or the same I

How to add self signed ssl certificate for loopback4?

Kevin I'm working on a microservice project based on loopback-next (loopback4), it's a simple service, so I want the application as an SSL endpoint. But I can't find any guide/documentation or example on how to configure SSL in lb4 generated code. Does anyone

How to avoid browser warnings when self-signed SSL certificate?

Stephan Ahlf I plan to deploy my own hardware device in the form of a RaspberryPi running a NodeJs server, which should include HTTPS communication. It is intended to run as an intranet device and will always be named with the same computer name (or the same I