HomeconnectLocal::TLS12PSK
TLS 1.2 + PSK support for Crystal/OpenSSL.
Crystal's stdlib OpenSSL bindings don't expose PSK callbacks or min/max protocol version setters, so we bridge to libssl directly.
Constants
SSL_CTRL_SET_MAX_PROTO_VERSION = 124
SSL_CTRL_SET_MIN_PROTO_VERSION = 123
SSL_CTRL constants from openssl/ssl.h
TLS1_2_VERSION = 771
OpenSSL TLS1_2_VERSION is 0x0303
Class methods
build_client_context(psk64 : String, identity : String = "homeconnect", cipher : String = "PSK") : OpenSSL::SSL::Context::Client
Build a client context that negotiates PSK over TLS 1.2.
cipher defaults to "PSK" (lets OpenSSL negotiate any PSK cipher suite supported by both peers). You may pass a narrower cipher string if you need.
decode_psk64(psk64 : String) : Bytes
Source