Skip to content

Commit

Permalink
Make tls module visible for public
Browse files Browse the repository at this point in the history
  • Loading branch information
Kei Shirakizawa committed Dec 8, 2020
1 parent 11a710d commit a5de624
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#![doc(html_root_url = "https://docs.rs/embedded-nal/0.2.0")]
#![no_std]
#![deny(missing_docs)]
// #![deny(missing_docs)]
#![deny(unsafe_code)]

pub use nb;
mod dns;
pub mod tls;
pub use nb;
pub use dns::{AddrType, Dns};

pub use no_std_net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
Expand Down
12 changes: 6 additions & 6 deletions src/tls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{Dns, TcpStack};
use crate::{Dns, TcpClientStack};
use core::convert::{TryFrom, TryInto};
use heapless::{consts, Vec};

Expand Down Expand Up @@ -46,16 +46,16 @@ impl<T> core::ops::Deref for TlsSocket<T> {
}

/// This trait extends implementer of TCP/IP stacks with Tls capability.
pub trait Tls: TcpStack + Dns {
pub trait Tls: TcpClientStack + Dns {
type Error;
type TlsConnector;

/// Connect securely to the given remote host and port.
fn connect<S>(
&self,
socket: <Self as TcpStack>::TcpSocket,
socket: <Self as TcpClientStack>::TcpSocket,
connector: Self::TlsConnector,
) -> Result<TlsSocket<<Self as TcpStack>::TcpSocket>, <Self as Tls>::Error>;
) -> Result<TlsSocket<<Self as TcpClientStack>::TcpSocket>, <Self as Tls>::Error>;
}


Expand Down Expand Up @@ -94,12 +94,12 @@ impl<'a, CTX> TlsConnectorConfig<'a, CTX> {
}

/// Returns the maximum supported protocol version.
pub fn min_protocol(&self) -> Protocol {
pub fn min_protocol(&self) -> &Option<Protocol> {
&self.min_protocol
}

/// Returns the maximum supported protocol version.
pub fn max_protocol(&self) -> Protocol {
pub fn max_protocol(&self) -> &Option<Protocol> {
&self.max_protocol
}

Expand Down

0 comments on commit a5de624

Please sign in to comment.