@@ -934,6 +934,17 @@ impl<H> Easy2<H> {
934934 self . setopt_str ( curl_sys:: CURLOPT_PROXY_SSLCERT , & sslcert)
935935 }
936936
937+ /// Set the client certificate for the proxy using an in-memory blob.
938+ ///
939+ /// The specified byte buffer should contain the binary content of the
940+ /// certificate, which will be copied into the handle.
941+ ///
942+ /// By default this option is not set and corresponds to
943+ /// `CURLOPT_PROXY_SSLCERT_BLOB`.
944+ pub fn proxy_sslcert_blob ( & mut self , blob : & [ u8 ] ) -> Result < ( ) , Error > {
945+ self . setopt_blob ( curl_sys:: CURLOPT_PROXY_SSLCERT_BLOB , blob)
946+ }
947+
937948 /// Set private key for HTTPS proxy.
938949 ///
939950 /// By default this value is not set and corresponds to
@@ -943,6 +954,17 @@ impl<H> Easy2<H> {
943954 self . setopt_str ( curl_sys:: CURLOPT_PROXY_SSLKEY , & sslkey)
944955 }
945956
957+ /// Set the pricate key for the proxy using an in-memory blob.
958+ ///
959+ /// The specified byte buffer should contain the binary content of the
960+ /// private key, which will be copied into the handle.
961+ ///
962+ /// By default this option is not set and corresponds to
963+ /// `CURLOPT_PROXY_SSLKEY_BLOB`.
964+ pub fn proxy_sslkey_blob ( & mut self , blob : & [ u8 ] ) -> Result < ( ) , Error > {
965+ self . setopt_blob ( curl_sys:: CURLOPT_PROXY_SSLKEY_BLOB , blob)
966+ }
967+
946968 /// Indicates the type of proxy being used.
947969 ///
948970 /// By default this option is `ProxyType::Http` and corresponds to
@@ -1929,6 +1951,18 @@ impl<H> Easy2<H> {
19291951 self . setopt_path ( curl_sys:: CURLOPT_SSLCERT , cert. as_ref ( ) )
19301952 }
19311953
1954+ /// Set the SSL client certificate using an in-memory blob.
1955+ ///
1956+ /// The specified byte buffer should contain the binary content of your
1957+ /// client certificate, which will be copied into the handle. The format of
1958+ /// the certificate can be specified with `ssl_cert_type`.
1959+ ///
1960+ /// By default this option is not set and corresponds to
1961+ /// `CURLOPT_SSLCERT_BLOB`.
1962+ pub fn ssl_cert_blob ( & mut self , blob : & [ u8 ] ) -> Result < ( ) , Error > {
1963+ self . setopt_blob ( curl_sys:: CURLOPT_SSLCERT_BLOB , blob)
1964+ }
1965+
19321966 /// Specify type of the client SSL certificate.
19331967 ///
19341968 /// The string should be the format of your certificate. Supported formats
@@ -1957,6 +1991,18 @@ impl<H> Easy2<H> {
19571991 self . setopt_path ( curl_sys:: CURLOPT_SSLKEY , key. as_ref ( ) )
19581992 }
19591993
1994+ /// Specify an SSL private key using an in-memory blob.
1995+ ///
1996+ /// The specified byte buffer should contain the binary content of your
1997+ /// private key, which will be copied into the handle. The format of
1998+ /// the private key can be specified with `ssl_key_type`.
1999+ ///
2000+ /// By default this option is not set and corresponds to
2001+ /// `CURLOPT_SSLKEY_BLOB`.
2002+ pub fn ssl_key_blob ( & mut self , blob : & [ u8 ] ) -> Result < ( ) , Error > {
2003+ self . setopt_blob ( curl_sys:: CURLOPT_SSLKEY_BLOB , blob)
2004+ }
2005+
19602006 /// Set type of the private key file.
19612007 ///
19622008 /// The string should be the format of your private key. Supported formats
@@ -2121,6 +2167,18 @@ impl<H> Easy2<H> {
21212167 self . setopt_path ( curl_sys:: CURLOPT_ISSUERCERT , path. as_ref ( ) )
21222168 }
21232169
2170+ /// Set the issuer SSL certificate using an in-memory blob.
2171+ ///
2172+ /// The specified byte buffer should contain the binary content of a CA
2173+ /// certificate in the PEM format. The certificate will be copied into the
2174+ /// handle.
2175+ ///
2176+ /// By default this option is not set and corresponds to
2177+ /// `CURLOPT_ISSUERCERT_BLOB`.
2178+ pub fn issuer_cert_blob ( & mut self , blob : & [ u8 ] ) -> Result < ( ) , Error > {
2179+ self . setopt_blob ( curl_sys:: CURLOPT_ISSUERCERT_BLOB , blob)
2180+ }
2181+
21242182 /// Specify directory holding CA certificates
21252183 ///
21262184 /// Names a directory holding multiple CA certificates to verify the peer
@@ -2957,6 +3015,16 @@ impl<H> Easy2<H> {
29573015 }
29583016 }
29593017
3018+ fn setopt_blob ( & mut self , opt : curl_sys:: CURLoption , val : & [ u8 ] ) -> Result < ( ) , Error > {
3019+ let blob = curl_sys:: curl_blob {
3020+ data : val. as_ptr ( ) as * const c_void as * mut c_void ,
3021+ len : val. len ( ) ,
3022+ flags : curl_sys:: CURL_BLOB_COPY ,
3023+ } ;
3024+ let blob_ptr = & blob as * const curl_sys:: curl_blob ;
3025+ unsafe { self . cvt ( curl_sys:: curl_easy_setopt ( self . inner . handle , opt, blob_ptr) ) }
3026+ }
3027+
29603028 fn getopt_bytes ( & mut self , opt : curl_sys:: CURLINFO ) -> Result < Option < & [ u8 ] > , Error > {
29613029 unsafe {
29623030 let p = self . getopt_ptr ( opt) ?;
0 commit comments