diff -up mysql-5.5.19/extra/yassl/src/ssl.cpp.yassl-cert mysql-5.5.19/extra/yassl/src/ssl.cpp --- mysql-5.5.19/extra/yassl/src/ssl.cpp.yassl-cert 2012-01-11 14:13:09.550433468 +0100 +++ mysql-5.5.19/extra/yassl/src/ssl.cpp 2012-01-11 14:14:04.065429739 +0100 @@ -272,8 +272,7 @@ int SSL_connect(SSL* ssl) ssl->useStates().UseConnect() = FIRST_REPLY_DONE; case FIRST_REPLY_DONE : - if(ssl->getCrypto().get_certManager().sendVerify()) - sendCertificate(*ssl); + sendCertificate(*ssl); if (!ssl->getSecurity().get_resuming()) sendClientKeyExchange(*ssl); diff -up mysql-5.5.19/extra/yassl/src/yassl_imp.cpp.yassl-cert mysql-5.5.19/extra/yassl/src/yassl_imp.cpp --- mysql-5.5.19/extra/yassl/src/yassl_imp.cpp.yassl-cert 2011-11-23 13:46:29.000000000 +0100 +++ mysql-5.5.19/extra/yassl/src/yassl_imp.cpp 2012-01-11 14:14:04.066429738 +0100 @@ -1051,7 +1051,10 @@ output_buffer& operator<<(output_buffer& Certificate::Certificate(const x509* cert) : cert_(cert) { - set_length(cert_->get_length() + 2 * CERT_HEADER); // list and cert size + if (cert_) + set_length(cert_->get_length() + 2 * CERT_HEADER); // list and cert size + else + set_length(CERT_HEADER); // empty cert } @@ -1064,14 +1067,19 @@ const opaque* Certificate::get_buffer() // output operator for Certificate output_buffer& operator<<(output_buffer& output, const Certificate& cert) { - uint sz = cert.get_length() - 2 * CERT_HEADER; + uint sz = 0; opaque tmp[CERT_HEADER]; - c32to24(sz + CERT_HEADER, tmp); - output.write(tmp, CERT_HEADER); + if (cert.get_length() > CERT_HEADER) + { + sz = cert.get_length() - 2 * CERT_HEADER; + c32to24(sz + CERT_HEADER, tmp); + output.write(tmp, CERT_HEADER); + } c32to24(sz, tmp); output.write(tmp, CERT_HEADER); - output.write(cert.get_buffer(), sz); + if (sz) + output.write(cert.get_buffer(), sz); return output; }