Commit 5d5d8a7
committed
ossl.c: implement OpenSSL::OpenSSLError#detailed_message
An OpenSSL function sometimes puts more than one error entry into the
thread-local error queue. We currently use the last, the highest level
entry for generating the exception message. The rest is silently
dropped unless OpenSSL.debug is set to true, which makes it print to
rb_warn().
Capture all current OpenSSL error queue contents into
OpenSSL::OpenSSLError#errors in ossl_make_error(), and extend
OpenSSL::OpenSSLError#detailed_message to include the information.
An example:
$ ruby -Ilib -ropenssl -e'OpenSSL::X509::ExtensionFactory.new.create_ext("a", "b")'
-e:1:in 'OpenSSL::X509::ExtensionFactory#create_ext': a = b: error in extension (name=a, value=b) (OpenSSL::X509::ExtensionError)
OpenSSL error queue reported 2 errors:
error:11000082:X509 V3 routines:do_ext_nconf:unknown extension name
error:11000080:X509 V3 routines:X509V3_EXT_nconf_int:error in extension (name=a, value=b)
from -e:1:in '<main>'1 parent 3e4c23e commit 5d5d8a7
2 files changed
+101
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
| |||
276 | 281 | | |
277 | 282 | | |
278 | 283 | | |
279 | | - | |
| 284 | + | |
280 | 285 | | |
281 | 286 | | |
282 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
| |||
300 | 307 | | |
301 | 308 | | |
302 | 309 | | |
303 | | - | |
304 | | - | |
| 310 | + | |
| 311 | + | |
305 | 312 | | |
306 | | - | |
| 313 | + | |
307 | 314 | | |
308 | 315 | | |
309 | | - | |
310 | 316 | | |
311 | 317 | | |
312 | 318 | | |
| |||
318 | 324 | | |
319 | 325 | | |
320 | 326 | | |
| 327 | + | |
| 328 | + | |
321 | 329 | | |
322 | 330 | | |
323 | 331 | | |
324 | | - | |
| 332 | + | |
325 | 333 | | |
326 | | - | |
327 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
328 | 339 | | |
329 | 340 | | |
330 | 341 | | |
331 | 342 | | |
332 | 343 | | |
333 | 344 | | |
334 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
335 | 397 | | |
336 | 398 | | |
337 | 399 | | |
| |||
1009 | 1071 | | |
1010 | 1072 | | |
1011 | 1073 | | |
1012 | | - | |
1013 | | - | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1014 | 1091 | | |
1015 | | - | |
| 1092 | + | |
| 1093 | + | |
1016 | 1094 | | |
1017 | 1095 | | |
1018 | 1096 | | |
| |||
1028 | 1106 | | |
1029 | 1107 | | |
1030 | 1108 | | |
| 1109 | + | |
1031 | 1110 | | |
1032 | 1111 | | |
1033 | 1112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | | - | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| |||
0 commit comments