Openssl -connect returns invalid certificate

Here is my problem. I have several domains hosted on the same apache web server. (Virtual hosts) Two of them (a.com and b.com) use ssl certificates. I configured both of these commands:

    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/ABC.crt
    SSLCertificateKeyFile /etc/apache2/ssl/ABC.key
    SSLCertificateChainFile /etc/apache2/ssl/ABC.chain.crt
    SSLProtocol             all -SSLv2

When I try to connect through a browser (chrome, Firefox, IE), it works fine and I get the correct certificate. But on android I got an exception: no peer certificates

Then I tried to test it with this command:

    openssl s_client -connect b.com:443

He returns me the a.com certificate. Any suggestions that I did wrong that I get the wrong certificate with openssl and android?

+4
source share
1 answer

, IP- , Server Name Indicication (SNI) . SNI openssl s_client -servername, . openssl s_client -connect b.com:443 -servername a.com. android: https://developer.android.com/training/articles/security-ssl.html, SNI 2.3 HttpsURLConnection, HTTP- Apache.

+10

Source: https://habr.com/ru/post/1547429/


All Articles