wwbmmm commented on code in PR #2251:
URL: https://github.com/apache/brpc/pull/2251#discussion_r1214037618
##########
src/brpc/details/ssl_helper.cpp:
##########
@@ -833,6 +841,35 @@ void Print(std::ostream& os, X509* cert, const char* sep) {
os << butil::StringPiece(bufp, len);
}
+bool BuildALPNProtocolList(
+ const std::vector<std::string>& alpn_protocols,
+ std::vector<unsigned char>& result
+) {
+ size_t alpn_list_length = 0;
+ for (const auto& alpn_protocol : alpn_protocols) {
+ if (alpn_protocol.size() > UCHAR_MAX) {
+ LOG(ERROR) << "Fail to build ALPN procotol list: "
Review Comment:
这里把alpn_protocol.size()打印一下?
##########
src/brpc/details/mesalink_ssl_helper.cpp:
##########
@@ -280,6 +280,14 @@ SSL_CTX* CreateClientSSLContext(const ChannelSSLOptions&
options) {
return NULL;
}
+ if (!options.alpn_protocols.empty()) {
+ std::vector<unsigned char> alpn_list;
+ if (!BuildALPNProtocolList(options.alpn_protocols, alpn_list)) {
+ return NULL;
+ }
+ SSL_CTX_set_alpn_protos(ssl_ctx.get(), alpn_list.data(),
alpn_list.size());
Review Comment:
mesalink是否支持这个功能?
https://github.com/mesalock-linux/mesalink/issues/36
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]