| 1594 | } |
| 1595 | |
| 1596 | X509* Socket::GetPeerCertificate() const { |
| 1597 | if (ssl_state() != SSL_CONNECTED) { |
| 1598 | return NULL; |
| 1599 | } |
| 1600 | BAIDU_SCOPED_LOCK(_ssl_session_mutex); |
| 1601 | return SSL_get_peer_certificate(_ssl_session); |
| 1602 | } |
| 1603 | |
| 1604 | int Socket::Write(butil::IOBuf* data, const WriteOptions* options_in) { |
| 1605 | WriteOptions opt; |