nghttpx: Use StringRef for tls_proto_list

This commit is contained in:
Tatsuhiro Tsujikawa 2016-10-02 22:21:38 +09:00
parent 5dd2704051
commit 97843e3874
5 changed files with 5 additions and 6 deletions

View File

@ -2448,8 +2448,7 @@ int process_options(Config *config,
tlsconf.npn_list = util::split_str(DEFAULT_NPN_LIST, ','); tlsconf.npn_list = util::split_str(DEFAULT_NPN_LIST, ',');
} }
if (tlsconf.tls_proto_list.empty()) { if (tlsconf.tls_proto_list.empty()) {
tlsconf.tls_proto_list = tlsconf.tls_proto_list = util::split_str(DEFAULT_TLS_PROTO_LIST, ',');
util::parse_config_str_list(DEFAULT_TLS_PROTO_LIST);
} }
tlsconf.tls_proto_mask = ssl::create_tls_proto_mask(tlsconf.tls_proto_list); tlsconf.tls_proto_mask = ssl::create_tls_proto_mask(tlsconf.tls_proto_list);

View File

@ -2309,7 +2309,7 @@ int parse_config(Config *config, int optid, const StringRef &opt,
return 0; return 0;
case SHRPX_OPTID_TLS_PROTO_LIST: case SHRPX_OPTID_TLS_PROTO_LIST:
config->tls.tls_proto_list = util::parse_config_str_list(optarg); config->tls.tls_proto_list = util::split_str(optarg, ',');
return 0; return 0;
case SHRPX_OPTID_VERIFY_CLIENT: case SHRPX_OPTID_VERIFY_CLIENT:

View File

@ -528,7 +528,7 @@ struct TLSConfig {
// preference. // preference.
std::vector<StringRef> npn_list; std::vector<StringRef> npn_list;
// list of supported SSL/TLS protocol strings. // list of supported SSL/TLS protocol strings.
std::vector<std::string> tls_proto_list; std::vector<StringRef> tls_proto_list;
BIO_METHOD *bio_method; BIO_METHOD *bio_method;
// Bit mask to disable SSL/TLS protocol versions. This will be // Bit mask to disable SSL/TLS protocol versions. This will be
// passed to SSL_CTX_set_options(). // passed to SSL_CTX_set_options().

View File

@ -495,7 +495,7 @@ constexpr TLSProtocol TLS_PROTOS[] = {
TLSProtocol{StringRef::from_lit("TLSv1.1"), SSL_OP_NO_TLSv1_1}, TLSProtocol{StringRef::from_lit("TLSv1.1"), SSL_OP_NO_TLSv1_1},
TLSProtocol{StringRef::from_lit("TLSv1.0"), SSL_OP_NO_TLSv1}}; TLSProtocol{StringRef::from_lit("TLSv1.0"), SSL_OP_NO_TLSv1}};
long int create_tls_proto_mask(const std::vector<std::string> &tls_proto_list) { long int create_tls_proto_mask(const std::vector<StringRef> &tls_proto_list) {
long int res = 0; long int res = 0;
for (auto &supported : TLS_PROTOS) { for (auto &supported : TLS_PROTOS) {

View File

@ -176,7 +176,7 @@ bool check_http2_requirement(SSL *ssl);
// Returns SSL/TLS option mask to disable SSL/TLS protocol version not // Returns SSL/TLS option mask to disable SSL/TLS protocol version not
// included in |tls_proto_list|. The returned mask can be directly // included in |tls_proto_list|. The returned mask can be directly
// passed to SSL_CTX_set_options(). // passed to SSL_CTX_set_options().
long int create_tls_proto_mask(const std::vector<std::string> &tls_proto_list); long int create_tls_proto_mask(const std::vector<StringRef> &tls_proto_list);
int set_alpn_prefs(std::vector<unsigned char> &out, int set_alpn_prefs(std::vector<unsigned char> &out,
const std::vector<StringRef> &protos); const std::vector<StringRef> &protos);