openssl handshake failed
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i'm trying to write simple C openssl client and server. Here is client's code: int main() { int err; SSL_CTX * ctx = init_ctx("client-cert.pem", "client-private.pem", "certs/cacert.pem", "clientpass"); if (!ctx) { fprintf(stderr, "couldn't init ctx\n"); exit(1); } int sock = tcp_connect("localhost", 4443); /* Connect the SSL socket */ SSL * ssl = SSL_new(ctx); BIO * sbio = BIO_new_socket(sock,BIO_NOCLOSE); SSL_set_bio(ssl,sbio,sbio); if((err = SSL_connect(ssl)) != 1) { switch(SSL_get_error(ssl, err)) { case SSL_ERROR_NONE: fprintf(stderr,