How to create server.crt and server.key for local web app


Certificate create operation as follows:

1. Create v3.ext file having following content:

distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
C = TW
ST = Taiwan
L = Taipei
O = CR
OU = It
CN = html_12
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names

2. run command

openssl req -new -newkey rsa:2048 -sha256 -days 3650 -nodes -x509 -keyout server.key -out server.crt -config v3.ext -extensions v3_req

3. Copy server.crt into C:\xampp\apache\conf\ssl.crt and server.key into C:\xampp\apache\conf\ssl.key

4. Rerun Xdebug to enable certificate

© 2019 All rights reserved. Codesenior.COM