Skip to content

Type Property

httpsUnixDomainSocket

Secure HyperText Transfer Protocol (HTTPS) over Unix Domain Sockets.
static let httpsUnixDomainSocket: URI.Scheme

Discussion

The socket path must be given as the URI’s “host” component, appropriately percent-encoded. The init(scheme:userinfo:host:port:path:query:fragment:) initializer adds such encoding automatically. To manually apply the correct encoding, use:

socketPath.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)

Note

The primary use case for this scheme is for local communication with servers (most often database servers) which require TLS client certificate authentication. In most other situations, the added encryption is unnecessary and will just slow things down.

(Well, unless your security concerns include other processes spying on your server’s communications when using UNIX sockets. But since doing that would require having already compromised the host kernel (“It rather involved being on the other side of this airtight hatchway.”), it seems fairly safe to say such a concern would be moot.)

Registration

None (non-standard)