1414-export ([handle_call /3 , handle_cast /2 , init /1 ,
1515 start_link /1 , terminate /2 , handle_info /2 ]).
1616
17- -export ([crl_file /0 ]).
17+ -export ([crl_file /0 , crl_file / 1 ]).
1818
19- -record (state , {socket , port , options , timer }).
19+ -record (state , {socket , port , options , timer , crl_path }).
2020
2121start_link (Port ) ->
2222 gen_server :start_link ({local , ? SERVER }, ? MODULE , Port ,
@@ -35,7 +35,7 @@ init(Port) ->
3535 gen_server :cast (self (), accept ),
3636 {ok ,
3737 # state {socket = ListenSocket , port = Port ,
38- options = Options , timer = TimerReference }}.
38+ options = Options , timer = TimerReference , crl_path = [] }}.
3939
4040% % Acceptor has only one state that goes in a loop:
4141% % 1. Listen for a connection from anyone.
@@ -57,11 +57,22 @@ handle_cast(accept,
5757 options = Options }}.
5858
5959handle_info (reload_crl_file , State ) ->
60- case crl_file () of
61- undefined -> {noreply , State };
62- {ok , File } ->
63- ssl_crl_cache :insert ({file , File }),
64- {noreply , State }
60+ crl_path = State # state .crl_path ,
61+ case crl_path of
62+ [] ->
63+ case crl_file () of
64+ undefined -> {noreply , State };
65+ {ok , File } ->
66+ ssl_crl_cache :insert ({file , File }),
67+ {noreply , State }
68+ end ;
69+ [_ ] ->
70+ case crl_file (crl_path ) of
71+ undefined -> {noreply , State };
72+ {ok , File } ->
73+ ssl_crl_cache :insert ({file , File }),
74+ {noreply , State }
75+ end
6576 end .
6677
6778terminate (_Reason , State ) ->
@@ -105,6 +116,10 @@ crl_file() ->
105116 {ok , CrlFile } -> epp_util :path_for_file (CrlFile )
106117 end .
107118
119+ crl_file (path ) ->
120+ epp_util :path_for_file (path ).
121+
122+
108123% % In some environments, we do not perform a CRL check. Therefore, we need
109124% % different options proplist.
110125handle_crl_check_options (Options ) ->
0 commit comments