| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hmssql.Connection.Tls
Description
TLS for both flavors of SQL Server encryption:
- Strict (TDS 8.0): TLS on the raw byte stream from byte zero, with ALPN
tds/8.0. The TDS packet stream runs inside the TLS session. - Hosted (TDS 7.x
ENCRYPT_ON/ENCRYPT_OFF): the TLS handshake records are carried inside TDS PRELOGIN packets; once the handshake completes, TLS records go directly on the byte stream and TDS packets go inside them.
Synopsis
- data TlsSettings = TlsSettings {}
- defaultTlsSettings :: TlsSettings
- buildCertificateStore :: TlsSettings -> IO CertificateStore
- strictTlsHandshake :: Connection -> TlsSettings -> String -> IO ()
- hostedTlsHandshake :: Connection -> TlsSettings -> String -> IO ()
Documentation
data TlsSettings Source #
How the server's certificate is validated, in every mode that uses TLS.
defaultTlsSettings validates against the system store; the fields add
trust, override the name checked, or turn validation off.
Constructors
| TlsSettings | |
Fields
| |
defaultTlsSettings :: TlsSettings Source #
Validate the server's certificate against the system store, for the host that was connected to, with no extra certificates trusted.
buildCertificateStore :: TlsSettings -> IO CertificateStore Source #
The certificates to validate a server against: the system store (if
tlsUseSystemCertificateStore), the files (read now: nothing is cached
by path, so a replaced file, even one with the modification time it
had, is what the next connection trusts) and the in-memory certificates.
strictTlsHandshake :: Connection -> TlsSettings -> String -> IO () Source #
TDS 8.0: negotiate TLS directly on the socket and switch the connection's
transport to it. Throws ProtocolError if the server's first byte is
not TLS, or if the handshake ends without the server selecting
tds/8.0; nothing is sent inside the session before that check.
hostedTlsHandshake :: Connection -> TlsSettings -> String -> IO () Source #
TDS 7.x: negotiate TLS with the handshake records wrapped in PRELOGIN packets, then switch the connection's transport to the TLS session.