Skip to content

Commit 923bfae

Browse files
author
Lin Liu
committed
CP-311259: Use Tls_policy to configure cipher suites
Signed-off-by: Lin Liu <lin.liu01@citrix.com>
1 parent 5a62181 commit 923bfae

6 files changed

Lines changed: 13 additions & 14 deletions

File tree

ocaml/libs/stunnel/stunnel.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ let config_file ?(accept = None) config host port =
222222
)
223223
; [Printf.sprintf "connect=%s:%d" host port]
224224
; [
225-
"sslVersion = TLSv1.2"
226-
; "ciphers = " ^ Constants.good_ciphersuites
227-
; "curve = secp384r1"
225+
"sslVersion = " ^ Tls_policy.Openssl.default_version
226+
; "ciphers = " ^ Tls_policy.Openssl.default_ciphers
227+
; "curve = " ^ Tls_policy.Openssl.default_curve
228228
]
229229
; ( match config with
230230
| None ->

ocaml/nbd/src/main.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ let init_tls_get_server_ctx ~certfile =
9292
let certfile = require_str "certfile" certfile in
9393
Some
9494
(Nbd_unix.TlsServer
95-
(Nbd_unix.init_tls_get_ctx ~curve:"secp384r1" ~certfile
96-
~ciphersuites:Constants.good_ciphersuites ()
95+
(Nbd_unix.init_tls_get_ctx ~curve:Tls_policy.Openssl.default_curve
96+
~certfile ~ciphersuites:Tls_policy.Openssl.default_ciphers ()
9797
)
9898
)
9999

ocaml/xapi-consts/constants.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,6 @@ let gencert = ref "/opt/xensource/libexec/gencert"
429429

430430
let openssl_path = ref "/usr/bin/openssl"
431431

432-
let good_ciphersuites =
433-
String.concat ":"
434-
["ECDHE-RSA-AES256-GCM-SHA384"; "ECDHE-RSA-AES128-GCM-SHA256"]
435-
436432
let verify_certificates_path = "/var/xapi/verify-certificates"
437433

438434
let python3_path = "/usr/bin/python3"

ocaml/xapi/extauth_plugin_ADwinbind.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,9 @@ let config_winbind_daemon domain_info =
952952
; "tls trust system cas = yes"
953953
; "tls verify peer = ca_and_name_if_available"
954954
; tls_ca
955+
; Printf.sprintf "tls ca directories = %s" certs_dir
956+
; Printf.sprintf "tls priority = %s"
957+
(Tls_policy.Gnutls.default_policy ())
955958
; Printf.sprintf "winbind scan trusted domains = %s"
956959
scan_trusted_domains
957960
; "winbind use krb5 enterprise principals = yes"

ocaml/xapi/sparse_dd_wrapper.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ let dd_internal progress_cb base prezeroed verify_cert ?(proto = None) infile
122122
; "-size"
123123
; Int64.to_string size
124124
; "-good-ciphersuites"
125-
; Constants.good_ciphersuites
125+
; Tls_policy.Openssl.default_ciphers
126126
]
127127
; ( if prezeroed then
128128
["-prezeroed"]

ocaml/xapi/xapi_stunnel_server.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ end = struct
5252
let open Printf in
5353
let cipher_options =
5454
[
55-
sprintf "ciphers = %s" Constants.good_ciphersuites
56-
; "curve = secp384r1"
57-
; "options = CIPHER_SERVER_PREFERENCE"
58-
; "sslVersion = TLSv1.2"
55+
sprintf "ciphers = %s" Tls_policy.Openssl.default_ciphers
56+
; "curve = " ^ Tls_policy.Openssl.default_curve
57+
; "options = " ^ Tls_policy.Openssl.default_server_preference
58+
; "sslVersion = " ^ Tls_policy.Openssl.default_version
5959
]
6060
in
6161
[

0 commit comments

Comments
 (0)