I am trying to verify a certificate using openssl. I verified the certificate chain itself and I want to check if the subject of the certificate matches the server name from the SSL field.
My code runs over the ssl sessions, First I want to extracted the server name from the packet (for this purpose I'm trying to use
ssl.handshake.extensions_server_name field in tshark) and check it against the domains in the output of the command
openssl x509 -text -noout cert.pem under the title: "X509v3 Subject Alternative Name".
It worked good on my test files, but while running the code on large file, it seems that there are ssl sessions that has no packet with the mentioned field (even though the browser didn't alert anything).
how can I still verify the name of the server ?
Note: I manually checked the "X509v3 Subject Alternative Name" of the certificate, and the names include the following list :
*.akamaihd.net, *.akamaihd-staging.net, a248.e.akamai.net, *.akamaized.net, *.akamaized-staging.net
Is it possible that my problem occurred because the names belongs to Akamai ? How can i solve the problem ?
Edit: The note isn't relevant, I checked the code on another file and I got the same problem with server that the certificate contains its name specifically. The question is - How is it possible that the server name is not included in the handshake? When such situation happens, how can i get a name that is supposed to be verified against the one in the certificate?
Thank you !