Commit 162ba310 authored by Anirudh Ramachandran's avatar Anirudh Ramachandran Committed by Facebook Github Bot

Fix mcrouter-oss build

Summary: D4624754 broke mcrouter-oss because that uses older OpenSSL (1.0.1).

Reviewed By: yfeldblum, jmswen

Differential Revision: D4670767

fbshipit-source-id: f297c8d3e013525bb36bd059eb40c70f0c4c2dcc
parent d1b51192
......@@ -128,17 +128,19 @@ folly::Optional<std::string> OpenSSLCertUtils::toString(X509& x509) {
throw std::runtime_error("Cannot allocate bio");
}
if (X509_print_ex(
in.get(),
&x509,
XN_FLAG_ONELINE,
X509_FLAG_NO_HEADER | /* A few bytes of cert and data */
X509_FLAG_NO_PUBKEY | /* Public key */
X509_FLAG_NO_IDS | /* Issuer/subject IDs */
X509_FLAG_NO_AUX | /* Auxiliary info? */
X509_FLAG_NO_SIGDUMP | /* Prints the signature */
X509_FLAG_NO_SIGNAME /* Signature algorithms */
) > 0) {
int flags = 0;
flags |= X509_FLAG_NO_HEADER | /* A few bytes of cert and data */
X509_FLAG_NO_PUBKEY | /* Public key */
X509_FLAG_NO_AUX | /* Auxiliary info? */
X509_FLAG_NO_SIGDUMP | /* Prints the signature */
X509_FLAG_NO_SIGNAME; /* Signature algorithms */
#ifdef X509_FLAG_NO_IDS
flags |= X509_FLAG_NO_IDS; /* Issuer/subject IDs */
#endif
if (X509_print_ex(in.get(), &x509, XN_FLAG_ONELINE, flags) > 0) {
char* bioData = nullptr;
size_t bioLen = BIO_get_mem_data(in.get(), &bioData);
return std::string(bioData, bioLen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment