Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

openssl - SSL - Insecure connection

I am using a self-signed certificate from OpenSSL on localhost with the URL https://localhost.com:3000 Chrome is complaining about an insecure connection. Your connection to this site is not secure This is my openssl.conf

[req]
default_bits = 2048
distinguished_name = dn
prompt             = no

[dn]
C="US"
ST="CA"
L="Venice Beach"
O="YIDAS"
OU="Service"
emailAddress="myemail@gmail.com"
CN="localhost.com"

[req_ext]
subjectAltName = DNS:127.0.0.1

[alt_names]
DNS.1=localhost.com 
DNS.2=$HOSTNAME 
IP.1=127.0.0.1
[v3_req]
keyUsage = critical, digitalSignature, keyAgreement
extendedKeyUsage = serverAuth
subjectAltName = DNS:127.0.0.1

Am I missing something?

question from:https://stackoverflow.com/questions/65888653/ssl-insecure-connection

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Need way more information. Chrome gives more information in the error message.

First, try using the address localhost and use it both in the CN and subjectAltName fields. An ip address is not a DNS name.

Second, verify that whatever server is using the created certificate by inspecting it from chrome.

Third, make sure the certificate is trusted by chrome by importing it into the chrome certificate store.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...