@@ -33,9 +33,12 @@ use common::*;
3333use elasticsearch:: cert:: { Certificate , CertificateValidation } ;
3434use os_type:: OSType ;
3535
36+ #[ allow( dead_code) ]
3637static CA_CERT : & [ u8 ] = include_bytes ! ( "../../.ci/certs/ca.crt" ) ;
38+ #[ allow( dead_code) ]
3739static CA_CHAIN_CERT : & [ u8 ] = include_bytes ! ( "../../.ci/certs/ca-chain.crt" ) ;
3840static TESTNODE_CERT : & [ u8 ] = include_bytes ! ( "../../.ci/certs/testnode.crt" ) ;
41+ #[ cfg( feature = "native-tls" ) ]
3942static TESTNODE_NO_SAN_CERT : & [ u8 ] = include_bytes ! ( "../../.ci/certs/testnode_no_san.crt" ) ;
4043
4144fn expected_error_message ( ) -> String {
@@ -116,7 +119,7 @@ async fn none_certificate_validation() -> Result<(), failure::Error> {
116119/// Certificate provided by the server contains the one given to the client
117120/// within the authority chain, and hostname matches
118121#[ tokio:: test]
119- #[ cfg( any( feature = "native-tls" , feature = "rustls-tls" ) ) ]
122+ #[ cfg( all ( not ( target_os = "macos" ) , any( feature = "native-tls" , feature = "rustls-tls" ) ) ) ]
120123async fn full_certificate_ca_validation ( ) -> Result < ( ) , failure:: Error > {
121124 let cert = Certificate :: from_pem ( CA_CERT ) ?;
122125 let builder =
@@ -128,7 +131,7 @@ async fn full_certificate_ca_validation() -> Result<(), failure::Error> {
128131
129132/// Try to load a certificate chain.
130133#[ tokio:: test]
131- #[ cfg( any( feature = "native-tls" , feature = "rustls-tls" ) ) ]
134+ #[ cfg( all ( any( feature = "native-tls" , feature = "rustls-tls" ) , not ( target_os = "macos" ) ) ) ]
132135async fn full_certificate_ca_chain_validation ( ) -> Result < ( ) , failure:: Error > {
133136 let mut cert = Certificate :: from_pem ( CA_CHAIN_CERT ) ?;
134137 cert. append ( Certificate :: from_pem ( CA_CERT ) ?) ;
@@ -154,7 +157,7 @@ async fn full_certificate_validation() -> Result<(), failure::Error> {
154157
155158/// Certificate provided by the server is the one given to the client and hostname matches, using rustls-tls
156159#[ tokio:: test]
157- #[ cfg( feature = "rustls-tls" ) ]
160+ #[ cfg( all ( linux , feature = "rustls-tls" ) ) ]
158161async fn full_certificate_validation_rustls_tls ( ) -> Result < ( ) , failure:: Error > {
159162 let mut chain: Vec < u8 > = Vec :: with_capacity ( TESTNODE_CERT . len ( ) + CA_CERT . len ( ) ) ;
160163 chain. extend ( CA_CERT ) ;
@@ -171,7 +174,7 @@ async fn full_certificate_validation_rustls_tls() -> Result<(), failure::Error>
171174/// Certificate provided by the server is the one given to the client. This fails on Linux because
172175/// it appears that it also needs the CA for the cert
173176#[ tokio:: test]
174- #[ cfg( all( unix , any( feature = "native-tls" , feature = "rustls-tls" ) ) ) ]
177+ #[ cfg( all( linux , any( feature = "native-tls" , feature = "rustls-tls" ) ) ) ]
175178async fn full_certificate_validation ( ) -> Result < ( ) , failure:: Error > {
176179 let cert = Certificate :: from_pem ( TESTNODE_CERT ) ?;
177180 let builder =
@@ -228,10 +231,10 @@ async fn certificate_certificate_validation() -> Result<(), failure::Error> {
228231 let result = client. ping ( ) . send ( ) . await ;
229232 let os_type = os_type:: current_platform ( ) ;
230233 match os_type. os_type {
231- OSType :: OSX => match result {
232- Ok ( _) => Ok ( ( ) ) ,
233- Err ( e) => Err ( failure:: err_msg ( e. to_string ( ) ) ) ,
234- } ,
234+ // OSType::OSX => match result {
235+ // Ok(_) => Ok(()),
236+ // Err(e) => Err(failure::err_msg(e.to_string())),
237+ // },
235238 _ => match result {
236239 Ok ( response) => Err ( failure:: err_msg ( format ! (
237240 "Expected error but response was {}" ,
@@ -255,7 +258,7 @@ async fn certificate_certificate_validation() -> Result<(), failure::Error> {
255258/// Certificate provided by the server contains the one given to the client
256259/// within the authority chain
257260#[ tokio:: test]
258- #[ cfg( feature = "native-tls" ) ]
261+ #[ cfg( all ( feature = "native-tls" , not ( target_os = "macos" ) ) ) ]
259262async fn certificate_certificate_ca_validation ( ) -> Result < ( ) , failure:: Error > {
260263 let cert = Certificate :: from_pem ( CA_CERT ) ?;
261264 let builder =
0 commit comments