Getting Chrome to accept self-signed localhost certificate

后端 未结 30 3361
小蘑菇
小蘑菇 2020-11-21 11:30

I have created a self-signed SSL certificate for the localhost CN. Firefox accepts this certificate after initially complaining about it, as expected. Chrome and IE, however

30条回答
  •  耶瑟儿~
    2020-11-21 11:58

    mkdir CA
    openssl genrsa -aes256 -out CA/rootCA.key 4096
    openssl req -x509 -new -nodes -key CA/rootCA.key -sha256 -days 1024 -out CA/rootCA.crt
    
    openssl req -new -nodes -keyout example.com.key -out domain.csr -days 3650 -subj "/C=US/L=Some/O=Acme, Inc./CN=example.com"
    openssl x509 -req -days 3650 -sha256 -in domain.csr -CA CA/rootCA.crt -CAkey CA/rootCA.key -CAcreateserial -out example.com.crt -extensions v3_ca -extfile <(
    cat <<-EOF
    [ v3_ca ]
    subjectAltName = DNS:example.com
    EOF
    )
    

提交回复
热议问题