glomp/network
This module contrains TLS settings as well as network related
error definitions. You use these through glomp.tls and the client’s
Disconnect events.
Types
An error from the network. You get one when connecting to the broker fails, or when reading from or writing to the connection fails.
pub type NetworkError {
ConnectionClosed
ConnectionRefused
ConnectionReset
ConnectionAborted
TimedOut
ConnectionTimedOut
SocketNotConnected
BrokenPipe
HostNotFound
HostDown
HostUnreachable
NetworkDown
NetworkUnreachable
AddressInUse
AddressNotAvailable
AddressFamilyNotSupported
TooManyOpenFiles
SystemFileTableFull
NoBufferSpace
OutOfMemory
PermissionDenied
OperationNotPermitted
InvalidArgument
TlsAlert(alert: TlsAlert, description: String)
TlsNotAvailable(reason: dynamic.Dynamic)
InvalidTlsOptions(details: dynamic.Dynamic)
CertificateFileUnreadable(
path: String,
reason: dynamic.Dynamic,
)
NoSystemCertificates(reason: dynamic.Dynamic)
UnknownNetworkError(reason: dynamic.Dynamic)
}
Constructors
-
ConnectionClosedThe other side closed the connection.
-
ConnectionRefusedThe host refused the connection.
-
ConnectionReset -
ConnectionAborted -
TimedOutGlomp’s own time limit ran out, such as the connect timeout.
-
ConnectionTimedOutThe operating system’s time limit for the connection ran out.
-
SocketNotConnected -
BrokenPipe -
HostNotFoundDNS found no address for the host.
-
HostDown -
HostUnreachable -
NetworkDown -
NetworkUnreachable -
AddressInUse -
AddressNotAvailable -
AddressFamilyNotSupported -
TooManyOpenFilesThis process has too many files open.
-
SystemFileTableFullThe whole system has too many files open.
-
NoBufferSpace -
OutOfMemory -
PermissionDenied -
OperationNotPermitted -
InvalidArgument -
TlsAlert(alert: TlsAlert, description: String)The TLS handshake failed with this alert.
descriptionis Erlang’s text for it. -
TlsNotAvailable(reason: dynamic.Dynamic)Erlang’s
sslapplication failed to start.reasonis its error. -
InvalidTlsOptions(details: dynamic.Dynamic)Erlang’s
sslrejected the options.detailsis its error. -
CertificateFileUnreadable(path: String, reason: dynamic.Dynamic)Reading the certificate file failed.
reasonis Erlang’s error. -
NoSystemCertificates(reason: dynamic.Dynamic)Loading the system’s certificate authorities failed.
reasonis Erlang’s error. -
UnknownNetworkError(reason: dynamic.Dynamic)Any other error.
reasonis Erlang’s error.
A TLS alert, which is the reason one side gives when it ends a TLS handshake. See RFC 8446 section 6.
pub type TlsAlert {
CloseNotify
UnexpectedMessage
BadRecordMac
RecordOverflow
HandshakeFailure
BadCertificate
UnsupportedCertificate
CertificateRevoked
CertificateExpired
CertificateUnknown
IllegalParameter
UnknownCa
AccessDenied
DecodeError
DecryptError
ProtocolVersion
InsufficientSecurity
InternalError
InappropriateFallback
UserCancelled
NoRenegotiation
MissingExtension
UnsupportedExtension
UnrecognisedName
BadCertificateStatusResponse
UnknownPskIdentity
CertificateRequired
NoApplicationProtocol
UnknownAlert(name: String)
}
Constructors
-
CloseNotify -
UnexpectedMessage -
BadRecordMac -
RecordOverflow -
HandshakeFailure -
BadCertificate -
UnsupportedCertificate -
CertificateRevoked -
CertificateExpired -
CertificateUnknown -
IllegalParameter -
UnknownCa -
AccessDenied -
DecodeError -
DecryptError -
ProtocolVersion -
InsufficientSecurity -
InternalError -
InappropriateFallback -
UserCancelled -
NoRenegotiation -
MissingExtension -
UnsupportedExtension -
UnrecognisedName -
BadCertificateStatusResponse -
UnknownPskIdentity -
CertificateRequired -
NoApplicationProtocol -
UnknownAlert(name: String)Any other alert.
Which certificates the client accepts from the broker over TLS. A certificate is how the broker proves it is the server you meant to reach.
pub type Trust {
SystemCertificates
CertificateFile(path: String)
Unverified
}
Constructors
-
SystemCertificatesCertificates signed by the system’s authorities. The host name is checked.
-
CertificateFile(path: String)Certificates signed by the authorities in this PEM file. The host name is checked.
-
UnverifiedAny certificate. Use it for testing only. With this setting anyone on the network can pose as the broker and read the traffic.