close

這次要來讓 apache 支援 ALPN 的 acme-tls/1 protocol

需要 mod_md

就照 github 上面 readme 安裝方式走

但我在 MAC 上沒這麼順利...

只好記錄下過程

1.

brew install httpd autoconf automake

2.

download mod_md-2.4.0

(注意 mod_md-2.4.2 需要 Apache httpd 2.4.48 or later)

3.

mod_md-2.4.0 目錄下執行

./buildconf

./configure --with-apxs=/usr/local/bin/apxs --enable-werror

如果遇到 link openssl lib 錯誤可嘗試執行

export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl@1.1/lib"

 

make

如果遇到 "apr_hooks.h" 找不到 (他在 apr-util include 裡面, 枉費我 apr 裡面找半天...)
如果遇到 "evp.h" 找不到 (他在 openssl include 裡面)

手動在目錄下的 Makefile 加上 include 路徑

ex:

CPPFLAGS =  -I/usr/local/opt/httpd/include/httpd -I/usr/local/opt/apr/libexec/include/apr-1 -I/usr/local/opt/apr-util/libexec/include/apr-1 -I/usr/local/opt/openssl/include

make install

4. 

最後就在 apche conf 加上 load module 和要新增的 acme-tls protocol

LoadModule md_module modules/mod_md.so

<IfModule http2_module>

H2Direct on

Protocols h2 http/1.1 acme-tls/1

Protocols h2c http/1.1

</IfModule>

5.

重起 apache

apachectl -k restart

6.

測試 protocol 是否可以成功使用

echo | openssl s_client -alpn acme-tls/1 -connect localhost:443

 

ref:

https://github.com/icing/mod_md

https://httpd.apache.org/docs/trunk/mod/mod_md.html

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JohnDX 的頭像
    JohnDX

    我要回家想一想~

    JohnDX 發表在 痞客邦 留言(0) 人氣()