0

I'm struggeling a few days with a self-sign certificate on Linux that Google Chrome or other browsers won't accept the certificate. Access to myintranet is only available local or via VPN.

DNS name 'myintranet'. LAMP Server IP 192.168.222.16

What I've got so far:

  1. Creating a configuration file

    [req]
    default_bits = 2048
    prompt = no
    default_md = sha256
    x509_extensions = v3_req
    distinguished_name = dn
    
    [dn]
    C = AT
    ST = MyState
    L = MyCity
    O = MyOrg
    emailAddress = email@mydomain.com 
    CN = myintranet
    
    [v3_req]
    subjectAltName = @alt_names
    
    [alt_names]
    DNS.1 = myintranet
    DNS.2 = 192.168.222.16
    
  2. Create certificate

    openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout mykey.key -days 3560 -out mycert.crt -config configuration.conf
    
  3. Create pfx file

    openssl.exe pkcs12 -export -out mypfx.pfx -inkey mykey.key -in mycert.crt"
    
  4. Enable SSL

    a2ensite default-ssl.conf
    
  5. Change path from crt and key in /etc/apache2/default-ssl.conf

    <IfModule mod_ssl.c>
        <VirtualHost _default_:443>
            ServerAdmin webmaster@localhost
            ServerName 192.168.222.16
            ServerAlias 192.168.222.16
            DocumentRoot /var/www/html
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            SSLEngine on
    
            SSLCertificateFile /etc/ssl/mycert.crt
            SSLCertificateKeyFile /etc/ssl/mykey.key
    
            ...
    
  6. Restart Server

    apache2ctl restart
    
  7. Download mycert.crt and install on Windows

If I open https://myintranet or https://192.168.222.16 on chrome it shows the red warning "not secure". In the certificate details

"Certification status"
This certificate is valid.

In can't find the "alt_names" in the certificate details but I don't know if this is my problem.

M1NT
  • 386
  • 1
  • 4
  • 13

0 Answers0