Lines Matching defs:new

39 //! let acceptor = Arc::new(acceptor.build());
128 let s = CString::new(std_name).unwrap();
170 /// Always start a new session when performing a renegotiation on the server side.
184 /// Creates a new key for each session when using ECDHE.
189 /// Creates a new key for each session when using DHE.
544 static INDEXES: Lazy<Mutex<HashMap<TypeId, c_int>>> = Lazy::new(|| Mutex::new(HashMap::new()));
545 static SSL_INDEXES: Lazy<Mutex<HashMap<TypeId, c_int>>> = Lazy::new(|| Mutex::new(HashMap::new()));
546 static SESSION_CTX_INDEX: OnceCell<Index<Ssl, SslContext>> = OnceCell::new();
709 /// Creates a new `SslContextBuilder`.
711 pub fn new(method: SslMethod) -> Result<SslContextBuilder, ErrorStack> {
734 /// Configures the certificate verification method for new connections.
742 /// Configures the certificate verification method for new connections and
759 /// Configures the server name indication (SNI) callback for new connections.
914 let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
976 let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
997 let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
1035 let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
1064 let cipher_list = CString::new(cipher_list).unwrap();
1085 let cipher_list = CString::new(cipher_list).unwrap();
1237 let cstr = CString::new(protocols).unwrap();
1392 /// Sets the callback which is called when new sessions are negotiated.
1397 /// the server may provide multiple session tokens to the client over a single session. The new
1568 let data = Box::into_raw(Box::new(data)) as *mut c_void;
1682 let sigalgs = CString::new(sigalgs).unwrap();
1695 let groups = CString::new(groups).unwrap();
1711 /// Consumes the builder, returning a new `SslContext`.
1758 /// Creates a new builder object for an `SslContext`.
1760 SslContextBuilder::new(method)
1763 /// Returns a new extra data index.
2213 /// Returns a new extra data index.
2247 /// Creates a new `Ssl`.
2253 pub fn new(ctx: &SslContextRef) -> Result<Ssl, ErrorStack> {
2280 SslStreamBuilder::new(self, stream).connect()
2299 SslStreamBuilder::new(self, stream).accept()
2372 // this needs to be in an Arc since the callback can register a new callback!
2373 self.set_ex_data(Ssl::cached_ex_index(), Arc::new(verify));
2395 // this needs to be in an Arc since the callback can register a new callback!
2396 self.set_ex_data(Ssl::cached_ex_index(), Arc::new(callback));
2423 // this needs to be in an Arc since the callback can register a new callback!
2424 self.set_ex_data(Ssl::cached_ex_index(), Arc::new(callback));
2501 let cstr = CString::new(hostname).unwrap();
2628 let cstr = CString::new(protocols).unwrap();
2842 /// session. If the server is not willing to reuse the session, a new one will be transparently
2932 let data = Box::new(data);
3203 /// Sets a new default TLS/SSL method for SSL objects
3220 let key_file = CString::new(p).unwrap();
3261 let cert_file = CString::new(p).unwrap();
3334 let cipher_list = CString::new(cipher_list).unwrap();
3353 let cipher_list = CString::new(cipher_list).unwrap();
3484 /// Creates a new `SslStream`.
3492 pub fn new(ssl: Ssl, stream: S) -> Result<Self, ErrorStack> {
3493 let (bio, method) = bio::new(stream)?;
3499 ssl: ManuallyDrop::new(ssl),
3500 method: ManuallyDrop::new(method),
3514 note = "use Ssl::from_ptr and SslStream::new instead"
3518 Self::new(ssl, stream).unwrap()
3811 .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e)));
3827 .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e)));
3853 pub fn new(ssl: Ssl, stream: S) -> Self {
3855 inner: SslStream::new(ssl, stream).unwrap(),
4158 static ONCE: Once = Once::new();
4180 static ONCE: Once = Once::new();