diff --git a/netdev.go b/netdev.go index 2d294c1..833804f 100644 --- a/netdev.go +++ b/netdev.go @@ -4,6 +4,12 @@ import ( "time" ) +const ( + // Made up, not a real IP protocol number. This is used to create a + // TLS socket on the device, assuming the device supports mbed TLS. + IPPROTO_TLS = 0xFE +) + // netdev is the current netdev, set by the application with useNetdev() var netdev netdever diff --git a/tlssock.go b/tlssock.go index b5653ed..6612e95 100644 --- a/tlssock.go +++ b/tlssock.go @@ -31,7 +31,7 @@ func DialTLS(addr string) (*TLSConn, error) { port = 443 } - fd, err := netdev.Socket(syscall.AF_INET, syscall.SOCK_STREAM, syscall.IPPROTO_TLS) + fd, err := netdev.Socket(syscall.AF_INET, syscall.SOCK_STREAM, IPPROTO_TLS) if err != nil { return nil, err }