File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88## [ Unreleased]
99
1010### Breaking
11+ - Added custom server certificate to ` http::client::Configuration `
1112- BT: ` BtDriver::set_device_name ` deprecated and not available with ESP-IDF 6.0+. Use the new ` EspGap::set_device_name ` instead
1213 or the existing ` EspBleGap::set_device_name `
1314- Implement MQTT outbox limit and get_outbox_size()
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ pub struct Configuration {
7676 pub timeout : Option < core:: time:: Duration > ,
7777 pub follow_redirects_policy : FollowRedirectsPolicy ,
7878 pub client_certificate : Option < X509 < ' static > > ,
79+ pub server_certificate : Option < X509 < ' static > > ,
7980 pub private_key : Option < X509 < ' static > > ,
8081 pub use_global_ca_store : bool ,
8182 pub crt_bundle_attach : Option < unsafe extern "C" fn ( conf : * mut core:: ffi:: c_void ) -> esp_err_t > ,
@@ -132,6 +133,18 @@ impl EspHttpConnection {
132133 native_config. timeout_ms = timeout. as_millis ( ) as _ ;
133134 }
134135
136+ if let Some ( cert) = configuration. server_certificate {
137+ #[ cfg( esp_idf_version_at_least_5_5_0) ]
138+ {
139+ native_config. __bindgen_anon_1 . cert_pem = cert. as_esp_idf_raw_ptr ( ) as _ ;
140+ }
141+ #[ cfg( not( esp_idf_version_at_least_5_5_0) ) ]
142+ {
143+ native_config. cert_pem = cert. as_esp_idf_raw_ptr ( ) as _ ;
144+ }
145+ native_config. cert_len = cert. as_esp_idf_raw_len ( ) ;
146+ }
147+
135148 if let ( Some ( cert) , Some ( private_key) ) =
136149 ( configuration. client_certificate , configuration. private_key )
137150 {
You can’t perform that action at this time.
0 commit comments