Skip to content

Commit 6ca0247

Browse files
committed
Revert "Hide self_signed behind feature flag"
This reverts commit 8812279.
1 parent 2fddd19 commit 6ca0247

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/gitlab.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ use http::{HeaderMap, Response as HttpResponse};
1515
use itertools::Itertools;
1616
use log::{debug, error, info};
1717
use reqwest::blocking::Client;
18-
#[cfg(any(feature = "client_der", feature = "client_pem"))]
19-
use reqwest::Certificate;
20-
use reqwest::Client as AsyncClient;
21-
18+
use reqwest::{Certificate, Client as AsyncClient};
2219
use serde::de::DeserializeOwned;
2320
use serde::Deserialize;
2421
use thiserror::Error;
@@ -30,7 +27,6 @@ use reqwest::Identity as TlsIdentity;
3027
use crate::api;
3128
use crate::auth::{Auth, AuthError};
3229

33-
#[cfg(any(feature = "client_der", feature = "client_pem"))]
3430
#[derive(Debug, Clone)]
3531
pub enum RootCertificate {
3632
Der(Vec<u8>),
@@ -147,7 +143,6 @@ enum CertPolicy {
147143
/// Trust all certificates (including expired certificates). This introduces significant
148144
/// vulnerabilities, and should only be used as a last resort.
149145
Insecure,
150-
#[cfg(any(feature = "client_der", feature = "client_pem"))]
151146
/// Trust certificates signed by the root certificate.
152147
SelfSigned(RootCertificate),
153148
}
@@ -189,7 +184,6 @@ impl Gitlab {
189184
)
190185
}
191186

192-
#[cfg(any(feature = "client_der", feature = "client_pem"))]
193187
/// Create a new Gitlab API representation, with a custom root certificate.
194188
///
195189
/// The `token` should be a valid [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html).
@@ -316,7 +310,6 @@ impl Gitlab {
316310
},
317311
}
318312
},
319-
#[cfg(any(feature = "client_der", feature = "client_pem"))]
320313
CertPolicy::SelfSigned(cert) => {
321314
let mut builder = Client::builder();
322315
match cert {
@@ -647,7 +640,6 @@ impl AsyncGitlab {
647640
},
648641
}
649642
},
650-
#[cfg(any(feature = "client_der", feature = "client_pem"))]
651643
CertPolicy::SelfSigned(cert) => {
652644
let mut builder = AsyncClient::builder();
653645
match cert {

src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,8 @@ pub use crate::auth::AuthError;
3333
#[cfg(feature = "client_api")]
3434
pub use crate::gitlab::{
3535
AsyncGitlab, Gitlab, GitlabBuilder, GitlabError, ImpersonationClient, RestError,
36+
RootCertificate,
3637
};
3738

38-
#[cfg(all(
39-
feature = "client_api",
40-
any(feature = "client_der", feature = "client_pem")
41-
))]
42-
pub use crate::gitlab::RootCertificate;
43-
4439
#[cfg(test)]
4540
mod test;

0 commit comments

Comments
 (0)