從前面步驟的存檔複製並解壓 ... 建設既OpenSSL和捲曲在同一個(測試)機的工作原理。
這聽起來像OpenSSL的生成計算機上啓用了下一步協議協商,但目標機器的OpenSSL的建沒有下一頁協議協商。對於OpenSSL 1.1.0,我相信這意味着構建機器配置了no-nextprotoneg
。對於OpenSSL 1.0.2及更低版本,我相信這意味着它被配置爲no-npn
。
SSL_CTX_set_alpn_protos
是OpenSSL 1.1.0的一部分。該.pod
是很重要的,因爲這意味着它的記載,所以它意味着一個公共職能由用戶程序調用(這是一個1.1.0政策變化):在1.0.2
$ cd openssl-master
$ grep -IR SSL_CTX_set_alpn_protos * | egrep '(ssl.h|.pod)'
doc/ssl/SSL_CTX_set_alpn_select_cb.pod:SSL_CTX_set_alpn_protos, SSL_set_alpn_protos, SSL_CTX_set_alpn_select_cb,
doc/ssl/SSL_CTX_set_alpn_select_cb.pod: int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,
doc/ssl/SSL_CTX_set_alpn_select_cb.pod:SSL_CTX_set_alpn_protos() and SSL_set_alpn_protos() are used by the client to
doc/ssl/SSL_CTX_set_alpn_select_cb.pod:SSL_CTX_set_alpn_protos() and SSL_set_alpn_protos() return 0 on success, and
include/openssl/ssl.h:__owur int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,
其還提供:
$ cd openssl-1.0.2g
$ grep -IR SSL_CTX_set_alpn_protos *
apps/s_client.c: SSL_CTX_set_alpn_protos(ctx, alpn, alpn_len);
ssl/ssl.h:int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,
ssl/ssl_lib.c: * SSL_CTX_set_alpn_protos sets the ALPN protocol list on |ctx| to |protos|.
ssl/ssl_lib.c:int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,
ssl/ssltest.c: SSL_CTX_set_alpn_protos(c_ctx, alpn, alpn_len);
util/ssleay.num:SSL_CTX_set_alpn_protos 387 EXIST::FUNCTION:
我的猜測是捲曲使用下級,發行提供的OpenSSL缺乏協議談判(如OpenSSL的0.9.8):
export LIBS='-ldl'
./configure --prefix="$(pwd)/<install_dir>" --with-ssl="<unpacked-tar>"
make && make install
檢查config.log
以查看配置過程中發現的捲曲。
可以在OpenSSL的關閉協議的談判與:
- OpenSSL的1.0.2 -
no-npn
- OpenSSL的1.1.0 -
no-nextprotoneg
它將<openssl/opensslconf.h
顯示:
$ cd openssl-master
$ ./config no-nextprotoneg
...
$ find $PWD -name 'opensslconf.h'
.../include/openssl/opensslconf.h
$ cat .../include/openssl/opensslconf.h | grep PROT
#ifndef OPENSSL_NO_NEXTPROTONEG
# define OPENSSL_NO_NEXTPROTONEG
和:
$ cd openssl-1.0.2g
$ ./config no-npn
...
$ cat include/openssl/opensslconf.h | grep NPN
#ifndef OPENSSL_NO_NPN
# define OPENSSL_NO_NPN
# if defined(OPENSSL_NO_NPN) && !defined(NO_NPN)
# define NO_NPN
所以,你也應該確認它沒有在構建時禁用。
它看起來像捲曲不完全同情no-npn
和no-nextprotoneg
:
$ git clone https://github.com/curl/curl.git
$ cd curl/
$ egrep -IR '(OPENSSL_NO_NPN|OPENSSL_NO_NEXTPROTONEG)' *
lib/vtls/openssl.c: && !defined(OPENSSL_NO_NEXTPROTONEG)
這也是爲SSL_CTX_set_alpn_protos
唯一命中:
$ grep -IR SSL_CTX_set_alpn_protos *
lib/vtls/openssl.c: SSL_CTX_set_alpn_protos(connssl->ctx, protocols, cur)
編輯的問題。從config.log來看,它看起來和預期的一樣。協議協商看起來不被禁用 –