hxcpp
created pr with
hxcpp/ssl-short-read.1
added hxcpp/ssl-short-read.2
1: d70d1ca < -: ------- SSL read/write needs to return wouldblock if partial read
-: ------- > 1: dd64130 SSL read/write needs to return wouldblock if partial read
2: af61d88 = 2: d3fe10a Throw exceptions for more error codes
3: 124b85a = 3: 6f33bf1 Retry handshake on would block
4: e8e22fe = 4: 5a504b4 Include whole erorr message in exception
cmds
checkout latest patchset:
ssh pr.pico.sh pull hxcpp:ssl-short-read | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull hxcpp:ssl-short-read [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh hxcpp:ssl-short-readadd comment to patch request:
ssh pr.pico.sh comment hxcpp:ssl-short-read "lgtm!"
Patchset
hxcpp/ssl-short-read.1
SSL read/write needs to return wouldblock if partial read
Stephen Paul Weber
Throw exceptions for more error codes
2026-10-27T21:17:55ZStephen Paul Weber
Retry handshake on would block
2026-10-27T21:18:19ZStephen Paul Weber
→ Include whole erorr message in exception
2026-10-27T21:18:51ZStephen Paul Weber
2026-10-27T21:19:11Z
Include whole erorr message in exception
Stephen Paul Weber
2026-10-27T21:19:11ZSemantic diff summary
0 added,
0 modified,
0 signature changed,
0 removed
across 0 analyzed files
(1 file skipped: unsupported file type)
+20
-1
Sources/c_borogove/src/hx/libs/ssl/SSL.cpp
#
| ... | ... | @@ -150,7 +150,26 @@ void _hx_ssl_handshake(Dynamic hssl) { | |
| 150 | 150 | sslctx* ctx = val_ssl(hssl); | |
| 151 | 151 | OSStatus s = SSLHandshake(ctx->sslCtx); | |
| 152 | 152 | if (s == errSSLWouldBlock) return _hx_ssl_handshake(hssl); | |
| 153 | - | if (s != noErr) hx::Throw(HX_CSTRING("SSL handshake error")); | |
| 153 | + | ||
| 154 | + | if (s != noErr) { | |
| 155 | + | CFStringRef message = SecCopyErrorMessageString(s, NULL); | |
| 156 | + | char description[256] = "Unknown error"; | |
| 157 | + | ||
| 158 | + | if (message) { | |
| 159 | + | CFStringGetCString( | |
| 160 | + | message, | |
| 161 | + | description, | |
| 162 | + | sizeof(description), | |
| 163 | + | kCFStringEncodingUTF8 | |
| 164 | + | ); | |
| 165 | + | CFRelease(message); | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | hx::Throw( | |
| 169 | + | String("SSL handshake error ") + | |
| 170 | + | String((int)s) + String(": ") + String(description) | |
| 171 | + | ); | |
| 172 | + | } | |
| 154 | 173 | } | |
| 155 | 174 | ||
| 156 | 175 | int _hx_ssl_send(Dynamic hssl, Array<unsigned char> buf, int p, int l) { |