I have made a programmer following this: OpenSSL Read/Write Handshake data with
Memory BIOBut now the function call SSL_do_handshake gets the error wrong
version number, do you have any idea?Here is the sample
code.client,SSL_set_bio(pssl, rbio, wbio);
SSL_set_connect_state(pssl);
SSL_do_handshake(pssl);
length = BIO_read(wbio, buffer,
length);server,SSL_CTX_load_verify_locations(global_sslctx , "cacerts.pem" ,
NULL);
SSL_CTX_use_certificate_file( global_sslctx , "cert.pem" , SSL_FILETYPE_PEM);
SSL_CTX_use_PrivateKey_file( global_sslctx , "cert.pem" , SSL_FILETYPE_PEM);
BIO_write(SSL_get_wbio(pssl) , pdata , length);
if (!SSL_is_init_finished(pssl)) {
SSL_do_handshake(pssl);
printf("%s" ,ERR_reason_error_string(ERR_get_error()));
}And i have dumped the momery data of the client,16 03 01 00 de 01 00 00 da 03
01 9b dc 1e ef 4d f6 74 96 9b 8a 3f c0 3f de 37 4c 1b fa d7 d8 04 12 79 f9 bf
92 38 d8 59 c0 4f b4 00 00 68 c0 14 c0 0a c0 22 c0 21 00 39 00 38 00 88 00 87
c0 0f c0 05 00
[email protected]