You can do that in one command:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365
You can also add -nodes
(short for no DES
) if you don’t want to protect your private key with a passphrase. Otherwise it will prompt you for “at least a 4 character” password.
The days
parameter (365) you can replace with any number to affect the expiration date. It will then prompt you for things like “Country Name”, but you can just hit Enter and accept the defaults.
Add -subj '/CN=localhost'
to suppress questions about the contents of the certificate (replace localhost
with your desired domain).
Self-signed certificates are not validated with any third party unless you import them to the browsers previously. If you need more security, you should use a certificate signed by a certificate authority (CA).
Related Posts:
- curl: (60) SSL certificate problem: unable to get local issuer certificate
- curl: (60) SSL certificate problem: unable to get local issuer certificate
- NET::ERR_CERT_REVOKED in Chrome, when the certificate is not actually revoked
- OpenSSL: unable to verify the first certificate for Experian URL
- how to download the ssl certificate from a website?
- Generating a self-signed cert with openssl that works in Chrome 58
- How to install OpenSSL in windows 10?
- SSL Error: unable to get local issuer certificate
- What is .crt and .key files and how to generate them?
- https connection using CURL from command line
- Convert .pem to .crt and .key
- Java: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- SSL_ERROR_BAD_CERT_DOMAIN
- What exactly is cacert.pem for?
- SSL CA cert (path? access rights?)
- How to disable cURL SSL certificate verification
- Getting error in Curl – Peer certificate cannot be authenticated with known CA certificates
- How do you sign a Certificate Signing Request with your Certification Authority?
- Java Keytool error after importing certificate , “keytool error: java.io.FileNotFoundException & Access Denied”
- Displaying a remote SSL certificate details using CLI tools
- How do I view the details of a digital certificate .cer file?
- How to view all ssl certificates in a bundle?
- Is there a reason to use an SSL certificate other than Let’s Encrypt’s free SSL?
- Wildcard SSL certificate for second-level subdomain
- Does each subdomain need it’s own SSL certificate?
- Best location to keep SSL certificates and private keys on Ubuntu servers?
- When you use ‘badidea’ or ‘thisisunsafe’ to bypass a Chrome certificate/HSTS error, does it only apply for the current site? [closed]
- When you use ‘badidea’ or ‘thisisunsafe’ to bypass a Chrome certificate/HSTS error, does it only apply for the current site? [closed]
- Received fatal alert: handshake_failure through SSLHandshakeException
- SSL_read failing with SSL_ERROR_SYSCALL error
- Received fatal alert: handshake_failure through SSLHandshakeException
- HTTPS connection Python
- CFNetwork SSLHandshake failed iOS 9
- Error Importing SSL certificate : Not an X.509 Certificate
- OpenSSL: PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: TRUSTED CERTIFICATE
- Caused by: java.security.UnrecoverableKeyException: Cannot recover key
- keytool error bash: keytool: command not found
- urllib and “SSL: CERTIFICATE_VERIFY_FAILED” Error
- Python requests SSL error – certificate verify failed
- Server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
- WordPress wp-admin https redirect loop
- Is it safe to use sslverify => true for with wp_remote_get/wp_remote_post
- Howto force SSL for all requests?
- Local version of a WordPress site – SSL/HTTPS enforced?
- Images causing Mixed Content with SSL
- bloginfo() and get_template_directory_uri() with SSL?
- Favicon causes mixed content warning over SSL
- I am locked out of my WordPress site after changing site URL from Http to Https
- Enabling SSL on wordpress results in 404
- SSL Certificate and WordPress
- Divert http to https with WordPress on IIS
- XML asset fails to load using https
- Search and replace http:// links to https:// to get the green padlock
- I changed my site from HTTPS back to HTTP and now it is broken- Cannot access Admin panel on HTTP URL
- How to set up HTTPS WordPress from Install Step?
- SSL certificate error on Google Chrome , IE [closed]
- How do I set up a local version of my https wordpress site for testing and development using MAMP
- Certain header elements not served over https
- Jetpack “Connect to WordPress” serving insecure content under HTTPS
- Allow non-SSL pages to use https or Force non-SSL pages to http?
- Website access with http and https
- Redirect the whole blog to SSL but not the RSS feed (under Nginx)
- WordPress 4.0 Forces entire site into SSL
- How to control SSL in WordPress for automatically changing http to https?
- All content is HTTPS, but browsers warn of HTTP mixed content [closed]
- How do I handle SSL properly when WP is behind a reverse proxy?
- How to keep WP from using https to get to wordpress.org?
- SSL doesn’t work on certain pages – what is wrong?
- WordPress site shown as Not Secure on Chrome when SSL certificate is valid
- ERR_TOO_MANY_REDIRECTS on wordpress page [closed]
- Disable WordPress accessing WordPress.org to check for updates
- How to protect login via SSL but not the rest of the dashboard
- The REST API request failed due to an error. cURL error 60: SSL certificate problem: certificate has expired
- Do I install WordPress from my Cpanel on https or http, if my website has valid certificate?
- SSL not working fine, Home url not matching with site url wordpress errors
- Website Migration (with https) to a new domain(http)
- How to move my local wordpress to https?
- Why does WordPress uses HTTPS for JS, CSS on EC2
- ERR_SSL_PROTOCOL_ERROR
- Problem forcing San SSL certificate on WordPress
- Front-end pages messed up due to HTTPS
- site on subdomain is redirecting to main site after installing wildcard ssl cert on both
- Forcing SSL (Bad Theme coding)
- WordPress Insecure Content
- SSL certificate breaks CSS (in combination with W3TC)
- I would like to add ssl certificate to my already existing wordpress site
- WordPress and SSL
- My WordPress site SSL is in red crossed color and can’t load at first time?
- SSL/HTTPS Redirect Loop
- The plain HTTP request was sent to HTTPS port in wordpress [closed]
- Adding SSL certificate to the front end of my site
- Moving WordPress from http to https over existing site
- WordPress stuck at Step 1 of setup behind nginx reverse proxy
- Issue when site move from ssl domain to new domain without ssl
- What is a challenge password?
- How do I clear Chrome’s SSL cache?
- Properly setting up a “default” nginx server for https
- Does each server behind a load balancer need their own SSL certificate?
- Changing my URL in General Settings cause the site to crash
- wordpress is auto using http: not https: as it needs to because the server is http behind a reverse proxy https, how do I stop it?