Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
kv_engine/include/memcached/openssl.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
41 lines (34 sloc)
1.22 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ | |
| /* | |
| * Copyright 2017-Present Couchbase, Inc. | |
| * | |
| * Use of this software is governed by the Business Source License included | |
| * in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | |
| * in that file, in accordance with the Business Source License, use of this | |
| * software will be governed by the Apache License, Version 2.0, included in | |
| * the file licenses/APL2.txt. | |
| */ | |
| #pragma once | |
| // The OpenSSL headers end up including winsock.h causing conflicting | |
| // types in programs depending on the order the include file is being | |
| // used. To work around those files being included we'll include winsock2.h | |
| // here via folly's Windows.h here. | |
| #include <folly/portability/Windows.h> | |
| #include <memory> | |
| #include <openssl/ssl.h> | |
| #include <openssl/bio.h> | |
| #include <openssl/err.h> | |
| namespace cb::openssl { | |
| struct X509deletor { | |
| void operator()(X509* cert) { | |
| X509_free(cert); | |
| } | |
| }; | |
| using unique_x509_ptr = std::unique_ptr<X509, X509deletor>; | |
| struct SSL_CTX_Deletor { | |
| void operator()(SSL_CTX* ctx) { | |
| SSL_CTX_free(ctx); | |
| } | |
| }; | |
| using unique_ssl_ctx_ptr = std::unique_ptr<SSL_CTX, SSL_CTX_Deletor>; | |
| } // namespace cb::openssl |