@@ -122,6 +122,7 @@ type verification_config = {
122122 sni : string option
123123 ; verify : verify
124124 ; cert_bundle_path : string
125+ ; crl_dir : string option
125126}
126127
127128type t = {
@@ -140,17 +141,24 @@ let appliance =
140141 sni= None
141142 ; verify= CheckHost
142143 ; cert_bundle_path= " /etc/stunnel/xapi-stunnel-ca-bundle.pem"
144+ ; crl_dir= Some crl_path
143145 }
144146
145147let pool =
146148 {
147149 sni= Some " pool"
148150 ; verify= VerifyPeer
149151 ; cert_bundle_path= " /etc/stunnel/xapi-pool-ca-bundle.pem"
152+ ; crl_dir= None
150153 }
151154
152155let external_host ext_host_cert_file =
153- {sni= None ; verify= VerifyPeer ; cert_bundle_path= ext_host_cert_file}
156+ {
157+ sni= None
158+ ; verify= VerifyPeer
159+ ; cert_bundle_path= ext_host_cert_file
160+ ; crl_dir= None
161+ }
154162
155163let debug_conf_of_bool verbose : string =
156164 if verbose then
@@ -219,7 +227,7 @@ let config_file ?(accept = None) config host port =
219227 ; ( match config with
220228 | None ->
221229 []
222- | Some {sni; verify; cert_bundle_path} ->
230+ | Some {sni; verify; cert_bundle_path; crl_dir } ->
223231 List. rev_append
224232 ( match verify with
225233 | VerifyPeer ->
@@ -234,14 +242,17 @@ let config_file ?(accept = None) config host port =
234242 ; " # the cert of the server we connect to"
235243 ; (match sni with None -> " " | Some s -> sprintf " sni = %s" s)
236244 ; sprintf " CAfile=%s" cert_bundle_path
237- ; ( match Sys. readdir crl_path with
238- | [||] ->
239- " "
240- | _ ->
241- sprintf " CRLpath=%s" crl_path
242- | exception _ ->
243- " "
244- )
245+ ; Option. fold ~none: " "
246+ ~some: (fun crl_dir ->
247+ match Sys. readdir crl_dir with
248+ | [||] ->
249+ " "
250+ | _ ->
251+ sprintf " CRLpath=%s" crl_dir
252+ | exception _ ->
253+ " "
254+ )
255+ crl_dir
245256 ]
246257 )
247258 ; [" " ]
0 commit comments