解决证书路径的问题

This commit is contained in:
anlicheng 2026-03-31 12:13:06 +08:00
parent bf9be7ebc5
commit c7036567e3
3 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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},
%% 单位为秒 %% 单位为秒

View File

@ -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},
%% 单位为秒 %% 单位为秒