mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-30 05:53:40 +00:00
Read a NUL-terminated client CA in SSLServer::PemMemory
SSLServer::PemMemory takes a length of 0 to mean a NUL-terminated string for cert_pem and key_pem, but skipped client_ca_pem when its length was 0, so a server given its client CA that way started without requiring client certificates. Read the client CA under the same rule as the other fields. An empty client CA now fails to load instead of turning the check off, and the README documents the length-0 rule.
This commit is contained in:
@@ -210,6 +210,8 @@ client_pem.key_pem_len = client_key.size();
|
||||
httplib::SSLClient cli("api.example.com", 443, client_pem);
|
||||
```
|
||||
|
||||
A length of 0 means the field is a NUL-terminated string.
|
||||
|
||||
`httplib::ws::WebSocketClient` has the same `PemMemory` constructor for `wss://` connections. See [README-websocket.md](README-websocket.md) for details.
|
||||
|
||||
### Peer Certificate Inspection
|
||||
|
||||
Reference in New Issue
Block a user