schannel

package
v1.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package schannel wraps the Windows Schannel provider.

Built only for windows. Elsewhere Supported reports false and the package contains no C.

Index

Constants

View Source
const (
	ProtocolTLS12 = 0x0303
	ProtocolTLS13 = 0x0304
)
View Source
const StatusKeyUnsupported uint32 = 0x80090302
View Source
const Supported = false

Supported reports whether this build has the backend compiled in.

Variables

This section is empty.

Functions

func Handshake

func Handshake(fd int, opt Options, timeoutNanos int64) (*Session, *Error)

Handshake always fails in this build.

Types

type Class

type Class int

Class is the coarse failure category from the C layer.

const (
	ClassOK Class = iota
	ClassAlloc
	ClassSetup
	ClassCA
	ClassClientCert
	ClassHandshake
	ClassTimeout
	ClassIO
	ClassClosed
)

type Error

type Error struct {
	Class  Class
	Status int
}

Error carries the class and the raw SECURITY_STATUS or HRESULT.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Timeout

func (e *Error) Timeout() bool

type Options

type Options struct {
	Host           string
	RootCAsDER     [][]byte
	RootCAsOnly    bool
	SkipVerify     bool
	MinVersion     uint16
	ClientCertDER  []byte
	ClientKeyDER   []byte
	ClientKeyPKCS8 bool
}

Options mirrors the real type so callers compile everywhere.

type Session

type Session struct{}

Session is a placeholder on platforms without the backend.

func (*Session) Close

func (s *Session) Close()

func (*Session) Read

func (s *Session) Read(p []byte, timeoutNanos int64) (int, *Error)

func (*Session) Write

func (s *Session) Write(p []byte, timeoutNanos int64) (int, *Error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL