pub struct Policy(/* private fields */);
Available on crate feature
provider-tls-default
only.Implementations§
Source§impl Policy
impl Policy
Sourcepub fn from_version(version: &str) -> Result<Policy, Error>
pub fn from_version(version: &str) -> Result<Policy, Error>
Construct a numbered security policy.
Numbered security policies are stable and will not change, in comparison to default security policies: DEFAULT and DEFAULT_TLS13.
See the s2n-tls usage guide for details on available policies: https://aws.github.io/s2n-tls/usage-guide/ch06-security-policies.html
use s2n_tls::{config, security};
let mut config = config::Builder::new();
// "20240501" is a numbered security policy. More information can be found
// in the linked s2n-tls usage guide.
let security_policy = match security::Policy::from_version("20240501") {
Ok(policy) => policy,
Err(e) => {
eprintln!("unable to construct the policy: {}", e);
return;
}
};
config.set_security_policy(&security_policy);
Trait Implementations§
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more