1#![deny(rust_2018_idioms, unreachable_pub, missing_debug_implementations)]
3
4use std::sync::atomic::{AtomicUsize, Ordering};
5
6#[cfg(feature = "openssl")]
7pub mod openssl;
8
9#[cfg(feature = "rustls")]
10pub mod rustls;
11
12use ntex_util::services::Counter;
13
14pub fn max_concurrent_ssl_accept(num: usize) {
21 MAX_SSL_ACCEPT.store(num, Ordering::Relaxed);
22 MAX_SSL_ACCEPT_COUNTER.with(|counts| counts.set_capacity(num));
23}
24
25static MAX_SSL_ACCEPT: AtomicUsize = AtomicUsize::new(256);
26
27thread_local! {
28 static MAX_SSL_ACCEPT_COUNTER: Counter = Counter::new(MAX_SSL_ACCEPT.load(Ordering::Relaxed));
29}
30
31#[derive(Clone, Debug, PartialEq, Eq, Hash)]
35pub struct PskIdentity(pub Vec<u8>);
36
37#[derive(Clone, Debug, PartialEq, Eq, Hash)]
41pub struct Servername(pub String);