I encountered this problem implementing app using tls v1.2 method and specifying SSL_VERIFY_PEER. Openssl function ssl3_get_cert_verify calls function method->ssl_get_message specifying a max message length of 514 bytes when in fact it can be longer when using tls 1.2 with peer cert verification. Upping this max length to 1024 solves my problem, though I'm not sure what the max would actually be?
Patch attached. Jean Cyr, Dillobits Software
openssl-1.0.1-stable-SNAP-20111217.patch
Description: Binary data