+ const std::string* ciphers = &tls11CipherString;
+ if (!tls11AltCipherlist.empty()) {
+ if (!cipherListPicker_) {
+ std::vector<int> weights;
+ std::for_each(
+ tls11AltCipherlist.begin(),
+ tls11AltCipherlist.end(),
+ [&](const std::pair<std::string, int>& e) {
+ weights.push_back(e.second);
+ });
+ cipherListPicker_.reset(
+ new std::discrete_distribution<int>(weights.begin(), weights.end()));
+ }
+ auto index = (*cipherListPicker_)(randomGenerator_);
+ if ((size_t)index >= tls11AltCipherlist.size()) {
+ LOG(ERROR) << "Trying to pick alt TLS11 cipher index " << index
+ << ", but tls11AltCipherlist is of length "
+ << tls11AltCipherlist.size();
+ } else {
+ ciphers = &tls11AltCipherlist[index].first;
+ }
+ }
+