From 706594d9c80bc06a2681d2319ab7196478eb7bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 12 Apr 2023 10:55:23 +0200 Subject: Fix Dialyzer warnings for OTP-26+ --- Makefile | 2 +- src/ranch_proxy_header.erl | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 48aa1f5..537c0e3 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ PROJECT_REGISTERED = ranch_server # Options. CT_OPTS += -pa test -ct_hooks ranch_ct_hook [] # -boot start_sasl -PLT_APPS = crypto public_key tools +PLT_APPS = common_test crypto ct_helper public_key stampede tools # Dependencies. diff --git a/src/ranch_proxy_header.erl b/src/ranch_proxy_header.erl index 8f73dba..254a969 100644 --- a/src/ranch_proxy_header.erl +++ b/src/ranch_proxy_header.erl @@ -886,7 +886,15 @@ v2_padding_test() -> %% this only ends up returning the keys protocol, selected_cipher_suite %% and sni_hostname *at most*. --spec to_connection_info(proxy_info()) -> ssl:connection_info(). +%% The type ssl:connection_info/0 is not exported. We just +%% replicate the relevant info tuples here. +-type ssl_connection_info() :: [ + {sni_hostname, term()} | + {selected_cipher_suite, ssl:erl_cipher_suite()} | + {protocol, ssl:protocol_version()} +]. + +-spec to_connection_info(proxy_info()) -> ssl_connection_info(). to_connection_info(ProxyInfo=#{ssl := SSL}) -> ConnInfo0 = case ProxyInfo of #{authority := Authority} -> -- cgit v1.2.3