Skip to content

Instantly share code, notes, and snippets.

@turtlepod
Created March 21, 2018 13:45
Show Gist options
  • Star 52 You must be signed in to star a gist
  • Fork 32 You must be signed in to fork a gist
  • Save turtlepod/3b8d8d0eef29de019951aa9d9dcba546 to your computer and use it in GitHub Desktop.
Save turtlepod/3b8d8d0eef29de019951aa9d9dcba546 to your computer and use it in GitHub Desktop.
[ req ]
default_bits = 2048
default_keyfile = server-key.pem
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
[ subject ]
countryName = Country Name (2 letter code)
countryName_default = US
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = NY
localityName = Locality Name (eg, city)
localityName_default = New York
organizationName = Organization Name (eg, company)
organizationName_default = Example, LLC
commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_default = {{DOMAIN}}
emailAddress = Email Address
emailAddress_default = test@example.com
[ x509_ext ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
subjectAltName = @alternate_names
nsComment = "OpenSSL Generated Certificate"
[ req_ext ]
subjectKeyIdentifier = hash
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
subjectAltName = @alternate_names
nsComment = "OpenSSL Generated Certificate"
[ alternate_names ]
DNS.1 = {{DOMAIN}}
@turtlepod
Copy link
Author

[ req ]

default_bits        = 2048
default_keyfile     = server-key.pem
distinguished_name  = subject
req_extensions      = req_ext
x509_extensions     = x509_ext
string_mask         = utf8only

[ subject ]

countryName                 = Country Name (2 letter code)
countryName_default         = US

stateOrProvinceName         = State or Province Name (full name)
stateOrProvinceName_default = NY

localityName                = Locality Name (eg, city)
localityName_default        = New York

organizationName            = Organization Name (eg, company)
organizationName_default    = Example, LLC

commonName                  = Common Name (e.g. server FQDN or YOUR name)
commonName_default          = site.test

emailAddress                = Email Address
emailAddress_default        = test@example.com

[ x509_ext ]

subjectKeyIdentifier   = hash
authorityKeyIdentifier = keyid,issuer

basicConstraints       = CA:FALSE
keyUsage               = digitalSignature, keyEncipherment
subjectAltName         = @alternate_names
nsComment              = "OpenSSL Generated Certificate"

[ req_ext ]

subjectKeyIdentifier = hash

basicConstraints     = CA:FALSE
keyUsage             = digitalSignature, keyEncipherment
subjectAltName       = @alternate_names
nsComment            = "OpenSSL Generated Certificate"

[ alternate_names ]

DNS.1       = site.test

@DomenicoCutrupi
Copy link

thank you soo much

@hussnainsheikh
Copy link

Hi there,

I have tried to install the SSL on my VPS(Windows) through your tutorial but after installed it is not working. Any idea why it is not working: https://app.famsart.nl/

@turtlepod
Copy link
Author

turtlepod commented Feb 14, 2020 via email

@PsyVenture
Copy link

Hi there,

I followed your tutorial and did all the steps described here: https://shellcreeper.com/?p=2573 but in the end the connection was still not secure. On my xammp control panel i have apache running on ports 80 and 443. Do you have any idea how can i troubleshoot and find out what is not working ?
Thanks in advance

@satendra12
Copy link

Hi there,

I followed your tutorial and did all the steps described here: https://shellcreeper.com/?p=2573 but in the end the connection was still not secure. On my xammp control panel i have apache running on ports 80 and 443. Do you have any idea how can i troubleshoot and find out what is not working ?
Thanks in advance

Also i am face same problem.

@lukademinnosa
Copy link

I have been working on the issue of securing my localhost but at last, the most valid explanation to be true....
Hands up.... the complete version link here >>> https://gist.github.com/adriansuter/f197dac4cf8570c2214642fa15299c33#file-cert-template-conf

@harshrajdubey
Copy link

Hi
I am unable to create a certificate
x509_extensions = x509_ext
unable to load x509 certificate
please help me

screenshot attached https://drive.google.com/file/d/1KZteETIcvrqbOlUDHGycCgFjjokaAIU9/view?usp=sharing

@ewwink
Copy link

ewwink commented Dec 15, 2021

certificate for wildcard subdomain, for example https://webku.lokal https://www.webku.lokal https://any.webku.lokal
replace

DNS.1       = {{DOMAIN}}

with

DNS.1       = *.{{DOMAIN}}
DNS.2       = {{DOMAIN}}

or

DNS.1       = *.webku.lokal
DNS.2       = webku.lokal

httpd-ssl.conf example

<VirtualHost *:443>
    DocumentRoot D:/xampp/htdocs/webku.lokal
    ServerName webku.lokal
    ServerAlias *.webku.lokal
    SSLEngine on
    SSLCertificateFile "crt/webku.lokal/server.crt"
    SSLCertificateKeyFile "crt/webku.lokal/server.key"
	<Directory "D:/xampp/htdocs/webku.lokal">
        Options All
	AllowOverride All
	Require all granted
    </Directory>
</VirtualHost>

@vujicicdragan
Copy link

It works for me!

@imseyed
Copy link

imseyed commented Apr 17, 2024

I have been working on the issue of securing my localhost but at last, the most valid explanation to be true....
Hands up.... the complete version link here >>> https://gist.github.com/adriansuter/f197dac4cf8570c2214642fa15299c33#file-cert-template-conf

I have been working on the issue of securing my localhost but at last, the most valid explanation to be true.... Hands up.... the complete version link here >>> https://gist.github.com/adriansuter/f197dac4cf8570c2214642fa15299c33#file-cert-template-conf

Thanks @lukademinnosa , this is the BEST code I found.
I suggest others to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment