+ /**
+ * Set default ciphers to be used in SSL handshake process.
+ */
+
+ template <typename Iterator>
+ void setCipherList(Iterator ibegin, Iterator iend) {
+ if (ibegin != iend) {
+ std::string opensslCipherList;
+ folly::join(":", ibegin, iend, opensslCipherList);
+ setCiphersOrThrow(opensslCipherList);
+ }
+ }
+
+ template <typename Container>
+ void setCipherList(const Container& cipherList) {
+ using namespace std;
+ setCipherList(begin(cipherList), end(cipherList));
+ }
+
+ template <typename Value>
+ void setCipherList(const std::initializer_list<Value>& cipherList) {
+ setCipherList(cipherList.begin(), cipherList.end());
+ }
+
+ /**
+ * Sets the signature algorithms to be used during SSL negotiation
+ * for TLS1.2+.
+ */
+
+ template <typename Iterator>
+ void setSignatureAlgorithms(Iterator ibegin, Iterator iend) {
+ if (ibegin != iend) {
+#if OPENSSL_VERSION_NUMBER >= 0x1000200fL
+ std::string opensslSigAlgsList;
+ join(":", ibegin, iend, opensslSigAlgsList);
+ if (!SSL_CTX_set1_sigalgs_list(ctx_, opensslSigAlgsList.c_str())) {
+ throw std::runtime_error("SSL_CTX_set1_sigalgs_list " + getErrors());
+ }
+#endif
+ }
+ }
+
+ template <typename Container>
+ void setSignatureAlgorithms(const Container& sigalgs) {
+ using namespace std;
+ setSignatureAlgorithms(begin(sigalgs), end(sigalgs));
+ }
+
+ template <typename Value>
+ void setSignatureAlgorithms(const std::initializer_list<Value>& sigalgs) {
+ setSignatureAlgorithms(sigalgs.begin(), sigalgs.end());
+ }
+
+ /**
+ * Sets the list of EC curves supported by the client.
+ *
+ * @param ecCurves A list of ec curves, eg: P-256
+ */
+ void setClientECCurvesList(const std::vector<std::string>& ecCurves);
+
+ /**
+ * Method to add support for a specific elliptic curve encryption algorithm.
+ *
+ * @param curveName: The name of the ec curve to support, eg: prime256v1.
+ */
+ void setServerECCurve(const std::string& curveName);
+
+ /**
+ * Sets an x509 verification param on the context.
+ */
+ void setX509VerifyParam(const ssl::X509VerifyParam& x509VerifyParam);
+