Documentation ¶
Index ¶
- Constants
- func GetCipherSuitesFormConfig(config []CipherSuitesType) (data []dtls.CipherSuiteID)
- func GetClientAuthTypeFromConfig(config ClientAuthType) (auth dtls.ClientAuthType)
- func NewUdpDTLSClient(ctx context.Context, addr *net.UDPAddr, certInfo CertificateInfo) (conn *dtls.Conn, err error)
- func NewUdpListen(ctx context.Context, addr *net.UDPAddr, config *Configuration, ...) (listener net.Listener, err error)
- func PathExists(path string) (bool, error)
- type CertificateInfo
- type CipherSuitesType
- type ClientAuthType
- type Configuration
- type PskConfig
- type UdpConnMap
Constants ¶
View Source
const ( SERVER_CERT_FILE = "certificates/server.pub.pem" SERVER_KEY_FILE = "certificates/server.pem" CLIENT_CERT_FILE = "certificates/client.pub.pem" CLIENT_KEY_FILE = "certificates/client.pem" CA_CERT_FILE = "certificates/server.pub.pem" )
Variables ¶
This section is empty.
Functions ¶
func GetCipherSuitesFormConfig ¶
func GetCipherSuitesFormConfig(config []CipherSuitesType) (data []dtls.CipherSuiteID)
func GetClientAuthTypeFromConfig ¶
func GetClientAuthTypeFromConfig(config ClientAuthType) (auth dtls.ClientAuthType)
func NewUdpDTLSClient ¶
func NewUdpListen ¶
func NewUdpListen(ctx context.Context, addr *net.UDPAddr, config *Configuration, certInfo CertificateInfo) (listener net.Listener, err error)
func PathExists ¶
Types ¶
type CertificateInfo ¶
type CipherSuitesType ¶
type CipherSuitesType = string
const ( // AES-128-CCM TLS_ECDHE_ECDSA_WITH_AES_128_CCM CipherSuitesType = "TLS_ECDHE_ECDSA_WITH_AES_128_CCM" TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 CipherSuitesType = "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8" // AES-128-GCM-SHA256 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 CipherSuitesType = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 CipherSuitesType = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" // AES-256-CBC-SHA TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA CipherSuitesType = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA CipherSuitesType = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" // For PSK TLS_PSK_WITH_AES_128_CCM CipherSuitesType = "TLS_PSK_WITH_AES_128_CCM" TLS_PSK_WITH_AES_128_CCM_8 CipherSuitesType = "TLS_PSK_WITH_AES_128_CCM_8" TLS_PSK_WITH_AES_128_GCM_SHA256 CipherSuitesType = "TLS_PSK_WITH_AES_128_GCM_SHA256" TLS_PSK_WITH_AES_128_CBC_SHA256 CipherSuitesType = "TLS_PSK_WITH_AES_128_CBC_SHA256" )
type ClientAuthType ¶
type ClientAuthType = string
const ( ClientAuthType_NoClientCert ClientAuthType = "NoClientCert" ClientAuthType_RequestClientCert ClientAuthType = "RequestClientCert" ClientAuthType_RequireAnyClientCert ClientAuthType = "RequireAnyClientCert" ClientAuthType_VerifyClientCertIfGiven ClientAuthType = "VerifyClientCertIfGiven" ClientAuthType_RequireAndVerifyClientCert ClientAuthType = "RequireAndVerifyClientCert" )
type Configuration ¶
type Configuration struct { EnableN4_DTLS bool `json:"enableN4_DTLS,omitempty" mapstructure:"enableN4_DTLS"` Psk *PskConfig `json:"psk,omitempty" mapstructure:"psk"` ClientAuth ClientAuthType `json:"clientAuth,omitempty" mapstructure:"clientAuth"` CipherSuites []CipherSuitesType `json:"cipherSuites,omitempty" mapstructure:"cipherSuites"` }
type UdpConnMap ¶
type UdpConnMap struct {
// contains filtered or unexported fields
}
func NewUdpConnMap ¶
func NewUdpConnMap() *UdpConnMap
func (*UdpConnMap) SendMsgToAddr ¶
func (c *UdpConnMap) SendMsgToAddr(addr string, msg []byte) (err error)
func (*UdpConnMap) UnRegister ¶
func (c *UdpConnMap) UnRegister(addr string)
Click to show internal directories.
Click to hide internal directories.