简体   繁体   中英

client rejecting server certificate

I am new to HTTPS/SSL. I need to write a HTTPS client which will reject all the connection by saying unknown CA. As I understand (through wireshark capture) during SSL connection, first client will send the 'client hello' message. In reply to this server will send message with three record - 'server hello', certificate, 'server hello done'.

What I am trying to achieve here is when the server will send certificate, client should always reject it.

I am trying to achieve it with following code but no luck.

How can I get LWP to validate SSL server certificates?

It's ok if solution is in some other language.

It should be enough to do the connection with no (or dummy) CA certificates known to the client. Have you tried setting SSL_ca_path and SSL_ca_file to dummy values?

Edit:

If any language goes, why not try openssl s s_client ?

openssl s_client -connect www.stackoverflow.com:443

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM