OpenSSL client not sending client certificate

后端 未结 3 1848
孤城傲影
孤城傲影 2021-01-04 22:31

I am struggling with a client certificate problem and hope somebody here can help me. I\'m developing a client/server pair using boost asio but I\'ll try to be unspecific. I

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-04 23:05

    You should not use both SSL_CTX_use_certificate_chain_file() and SSL_CTX_use_certificate_file(), as SSL_CTX_use_certificate_chain_file() tries to load a chain including the client certificate, not just the CA chain. From SSL_CTX_use_certificate(3):

    SSL_CTX_use_certificate_chain_file() loads a certificate chain from file into ctx. The certificates must be in PEM format and must be sorted starting with the subject's certificate (actual client or server certificate), followed by intermediate CA certificates if applicable, and ending at the highest level (root) CA.

    I think you should be fine using only SSL_CTX_use_certificate_file() and SSL_CTX_use_PrivateKey_file(), as the client does not care much for the CA chain anyway.

提交回复
热议问题