解决证书路径的问题
This commit is contained in:
parent
bf9be7ebc5
commit
c7036567e3
@ -20,13 +20,17 @@ init() ->
|
|||||||
Port = proplists:get_value(port, Props),
|
Port = proplists:get_value(port, Props),
|
||||||
Alpn = proplists:get_value(alpn, Props),
|
Alpn = proplists:get_value(alpn, Props),
|
||||||
Limits = proplists:get_value(limits, Props),
|
Limits = proplists:get_value(limits, Props),
|
||||||
|
CertFile = proplists:get_value(certfile, Props),
|
||||||
|
KeyFile = proplists:get_value(keyfile, Props),
|
||||||
|
|
||||||
|
%% 获取环境变量
|
||||||
|
Path = os:getenv("QUIC_CERT_PATH", code:priv_dir(sdlan)),
|
||||||
|
|
||||||
Path = code:priv_dir(sdlan),
|
|
||||||
LOptions = #{
|
LOptions = #{
|
||||||
addr_family => inet,
|
addr_family => inet,
|
||||||
% 必选:QUIC/TLS证书配置
|
% 必选:QUIC/TLS证书配置
|
||||||
certfile => Path ++ "/cert.pem",
|
certfile => Path ++ "/" ++ CertFile,
|
||||||
keyfile => Path ++ "/key.pem",
|
keyfile => Path ++ "/" ++ KeyFile,
|
||||||
alpn => Alpn,
|
alpn => Alpn,
|
||||||
peer_bidi_stream_count => 1,
|
peer_bidi_stream_count => 1,
|
||||||
conn_acceptors => 10
|
conn_acceptors => 10
|
||||||
|
|||||||
@ -11,6 +11,8 @@
|
|||||||
{quic_server, [
|
{quic_server, [
|
||||||
{port, 443},
|
{port, 443},
|
||||||
{alpn, ["punchnet/1.0"]},
|
{alpn, ["punchnet/1.0"]},
|
||||||
|
{certfile, "cert.pem"},
|
||||||
|
{keyfile, "key.pem"},
|
||||||
{limits, [
|
{limits, [
|
||||||
{max_packet_size, 16384},
|
{max_packet_size, 16384},
|
||||||
%% 单位为秒
|
%% 单位为秒
|
||||||
|
|||||||
@ -11,6 +11,8 @@
|
|||||||
{quic_server, [
|
{quic_server, [
|
||||||
{port, 443},
|
{port, 443},
|
||||||
{alpn, ["punchnet/1.0"]},
|
{alpn, ["punchnet/1.0"]},
|
||||||
|
{certfile, "fullchain.cer"},
|
||||||
|
{keyfile, "punchsky.com.key"},
|
||||||
{limits, [
|
{limits, [
|
||||||
{max_packet_size, 16384},
|
{max_packet_size, 16384},
|
||||||
%% 单位为秒
|
%% 单位为秒
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user