Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

CA-83270: fix incompatible changes with XOP-229. #130

Merged
merged 1 commit into from

2 participants

@jeromemaloberti

Signed-off-by: Jerome Maloberti jerome.maloberti@citrix.com

@jeromemaloberti jeromemaloberti CA-83270: fix incompatible changes with XOP-229.
Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
2a13ba9
@thomassa
Owner

The build was broken before this change, and this should fix it, so I shall merge this pull-request even though the automatic merge-build for it is still running.

@thomassa thomassa merged commit b42d0a8 into xapi-project:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2013
  1. @jeromemaloberti

    CA-83270: fix incompatible changes with XOP-229.

    jeromemaloberti authored
    Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
This page is out of date. Refresh to see the latest.
View
5 http-svr/xmlrpc_client.ml
@@ -96,10 +96,11 @@ let get_new_stunnel_id =
(** Returns an stunnel, either from the persistent cache or a fresh one which
has been checked out and guaranteed to work. *)
-let get_reusable_stunnel ?use_fork_exec_helper ?write_to_log host port verify_cert =
+let get_reusable_stunnel ?use_fork_exec_helper ?write_to_log host port ?verify_cert =
let start_time = Unix.gettimeofday () in
let found = ref None in
(* 1. First check if there is a suitable stunnel in the cache. *)
+ let verify_cert = Stunnel.must_verify_cert verify_cert in
begin
try
while !found = None do
@@ -213,7 +214,7 @@ let with_transport transport f = match transport with
task_id = task_id}, host, port) ->
let st_proc =
if use_stunnel_cache
- then get_reusable_stunnel ~use_fork_exec_helper ~write_to_log host port verify_cert
+ then get_reusable_stunnel ~use_fork_exec_helper ~write_to_log host port ?verify_cert
else
let unique_id = get_new_stunnel_id () in
Stunnel.connect ~use_fork_exec_helper ~write_to_log ~unique_id ?verify_cert ~extended_diagnosis:true host port in
View
9 stunnel/stunnel.ml
@@ -254,6 +254,11 @@ let rec retry f = function
ignore(Unix.select [] [] [] 3.);
retry f (n - 1)
+let must_verify_cert verify_cert =
+ match verify_cert with
+ | Some x -> x
+ | None -> Sys.file_exists verify_certificates_ctrl
+
(** Establish a fresh stunnel to a (host, port)
@param extended_diagnosis If true, the stunnel log file will not be
deleted. Instead, it is the caller's responsibility to delete it. This
@@ -266,9 +271,7 @@ let connect
?(extended_diagnosis=false)
host
port =
- let _verify_cert = match verify_cert with
- | Some x -> x
- | None -> Sys.file_exists verify_certificates_ctrl in
+ let _verify_cert = must_verify_cert verify_cert in
let _ = match write_to_log with
| Some logger -> stunnel_logger := logger
| None -> () in
View
2  stunnel/stunnel.mli
@@ -56,3 +56,5 @@ val disconnect : ?wait:bool -> ?force:bool -> t -> unit
val diagnose_failure : t -> unit
val test : string -> int -> unit
+
+val must_verify_cert : bool option -> bool
Something went wrong with that request. Please try again.