Tests: fixed ssl_certificate.t with LibreSSL client.

Net::SSLeay::connect() that manages TLS handshake could return unexpected
error when receiving server alert, as seen in server certificate tests if
it could not been selected.  Typically, it returns the expected error -1,
but with certain libssl implementations it can be 0, as explained below.

The error is propagated from libssl's SSL_connect(), which is usually -1.
In modern OpenSSL versions, it is the default error code used in the state
machine returned when something went wrong with parsing TLS message header.
In versions up to OpenSSL 1.0.2, with SSLv23_method() used by default, -1
is the only error code in the ssl_connect() method implementation which is
used as well if receiving alert while parsing ServerHello.  BoringSSL also
seems to return -1.  But it is not so with LibreSSL that returns zero.

Previously, tests failed with client built with LibreSSL with SSLv3 removed.
Here, the error is propagated directly from ssl_read_bytes() method, which
is always implemented as ssl3_read_bytes() in all TLS methods.  It could be
also seen with OpenSSL up to 1.0.2 with non-default methods explicitly set.
1 file changed
tree: 714a72f38fcaaeeec9109db7083a60256fdee3f1
  1. lib/
  2. access.t
  3. access_log.t
  4. access_log_variables.t
  5. addition.t
  6. addition_buffered.t
  7. auth_basic.t
  8. auth_delay.t
  9. auth_request.t
  10. auth_request_satisfy.t
  11. auth_request_set.t
  12. autoindex.t
  13. autoindex_format.t
  14. binary_upgrade.t
  15. body.t
  16. body_chunked.t
  17. charset.t
  18. charset_gzip_static.t
  19. config_dump.t
  20. dav.t
  21. dav_chunked.t
  22. debug_connection.t
  23. debug_connection_syslog.t
  24. debug_connection_unix.t
  25. empty_gif.t
  26. error_log.t
  27. fastcgi.t
  28. fastcgi_body.t
  29. fastcgi_body2.t
  30. fastcgi_buffering.t
  31. fastcgi_cache.t
  32. fastcgi_header_params.t
  33. fastcgi_keepalive.t
  34. fastcgi_merge_params.t
  35. fastcgi_merge_params2.t
  36. fastcgi_request_buffering.t
  37. fastcgi_request_buffering_chunked.t
  38. fastcgi_split.t
  39. fastcgi_unix.t
  40. fastcgi_variables.t
  41. geo.t
  42. geo_binary.t
  43. geo_ipv6.t
  44. geo_unix.t
  45. geoip.t
  46. grpc.t
  47. grpc_next_upstream.t
  48. grpc_pass.t
  49. grpc_request_buffering.t
  50. grpc_ssl.t
  51. gunzip.t
  52. gunzip_memcached.t
  53. gunzip_perl.t
  54. gunzip_ssi.t
  55. gunzip_static.t
  56. gzip.t
  57. gzip_flush.t
  58. h2.t
  59. h2_auth_request.t
  60. h2_fastcgi_request_buffering.t
  61. h2_headers.t
  62. h2_limit_conn.t
  63. h2_limit_req.t
  64. h2_max_requests.t
  65. h2_priority.t
  66. h2_proxy_cache.t
  67. h2_proxy_protocol.t
  68. h2_proxy_request_buffering.t
  69. h2_proxy_request_buffering_redirect.t
  70. h2_proxy_request_buffering_ssl.t
  71. h2_proxy_ssl.t
  72. h2_request_body.t
  73. h2_request_body_preread.t
  74. h2_server_push.t
  75. h2_server_tokens.t
  76. h2_ssl.t
  77. h2_ssl_proxy_cache.t
  78. h2_ssl_variables.t
  79. h2_ssl_verify_client.t
  80. h2_trailers.t
  81. h2_variables.t
  82. headers.t
  83. http_absolute_redirect.t
  84. http_disable_symlinks.t
  85. http_error_page.t
  86. http_expect_100_continue.t
  87. http_header_buffers.t
  88. http_host.t
  89. http_include.t
  90. http_keepalive.t
  91. http_listen.t
  92. http_location.t
  93. http_location_auto.t
  94. http_location_win32.t
  95. http_resolver.t
  96. http_resolver_aaaa.t
  97. http_resolver_cleanup.t
  98. http_resolver_cname.t
  99. http_server_name.t
  100. http_try_files.t
  101. http_uri.t
  102. http_variables.t
  103. ignore_invalid_headers.t
  104. image_filter.t
  105. image_filter_finalize.t
  106. image_filter_webp.t
  107. index.t
  108. js.t
  109. js_async.t
  110. js_dump.t
  111. js_headers.t
  112. js_import.t
  113. js_internal_redirect.t
  114. js_modules.t
  115. js_object.t
  116. js_paths.t
  117. js_promise.t
  118. js_request_body.t
  119. js_return.t
  120. js_subrequests.t
  121. js_variables.t
  122. LICENSE
  123. limit_conn.t
  124. limit_conn_complex.t
  125. limit_conn_dry_run.t
  126. limit_rate.t
  127. limit_req.t
  128. limit_req2.t
  129. limit_req_delay.t
  130. limit_req_dry_run.t
  131. mail_capability.t
  132. mail_error_log.t
  133. mail_imap.t
  134. mail_imap_ssl.t
  135. mail_pop3.t
  136. mail_resolver.t
  137. mail_smtp.t
  138. mail_smtp_greeting_delay.t
  139. mail_smtp_xclient.t
  140. mail_ssl.t
  141. map.t
  142. map_complex.t
  143. map_volatile.t
  144. memcached.t
  145. memcached_fake.t
  146. memcached_keepalive.t
  147. memcached_keepalive_stale.t
  148. merge_slashes.t
  149. mirror.t
  150. mirror_proxy.t
  151. mp4.t
  152. mp4_ssi.t
  153. msie_refresh.t
  154. not_modified.t
  155. not_modified_finalize.t
  156. not_modified_proxy.t
  157. perl.t
  158. perl_gzip.t
  159. perl_sleep.t
  160. perl_ssi.t
  161. post_action.t
  162. proxy.t
  163. proxy_bind.t
  164. proxy_bind_transparent.t
  165. proxy_bind_transparent_capability.t
  166. proxy_cache.t
  167. proxy_cache_bypass.t
  168. proxy_cache_chunked.t
  169. proxy_cache_convert_head.t
  170. proxy_cache_error.t
  171. proxy_cache_lock.t
  172. proxy_cache_lock_age.t
  173. proxy_cache_lock_ssi.t
  174. proxy_cache_manager.t
  175. proxy_cache_max_range_offset.t
  176. proxy_cache_path.t
  177. proxy_cache_range.t
  178. proxy_cache_revalidate.t
  179. proxy_cache_use_stale.t
  180. proxy_cache_valid.t
  181. proxy_cache_variables.t
  182. proxy_cache_vary.t
  183. proxy_chunked.t
  184. proxy_cookie.t
  185. proxy_force_ranges.t
  186. proxy_if.t
  187. proxy_keepalive.t
  188. proxy_limit_rate.t
  189. proxy_merge_headers.t
  190. proxy_method.t
  191. proxy_next_upstream.t
  192. proxy_next_upstream_tries.t
  193. proxy_noclose.t
  194. proxy_non_idempotent.t
  195. proxy_pass_request.t
  196. proxy_protocol.t
  197. proxy_protocol2.t
  198. proxy_protocol2_server.t
  199. proxy_protocol_ipv6.t
  200. proxy_protocol_server.t
  201. proxy_redirect.t
  202. proxy_request_buffering.t
  203. proxy_request_buffering_chunked.t
  204. proxy_request_buffering_keepalive.t
  205. proxy_request_buffering_ssl.t
  206. proxy_set_body.t
  207. proxy_ssi_body.t
  208. proxy_ssl.t
  209. proxy_ssl_certificate.t
  210. proxy_ssl_keepalive.t
  211. proxy_ssl_name.t
  212. proxy_ssl_verify.t
  213. proxy_store.t
  214. proxy_unfinished.t
  215. proxy_unix.t
  216. proxy_upgrade.t
  217. proxy_upstream_cookie.t
  218. proxy_variables.t
  219. proxy_websocket.t
  220. proxy_xar.t
  221. random_index.t
  222. range.t
  223. range_charset.t
  224. range_flv.t
  225. range_if_range.t
  226. range_mp4.t
  227. README
  228. realip.t
  229. realip_hostname.t
  230. realip_remote_addr.t
  231. realip_remote_port.t
  232. referer.t
  233. request_id.t
  234. rewrite.t
  235. rewrite_if.t
  236. rewrite_set.t
  237. rewrite_unescape.t
  238. scgi.t
  239. scgi_body.t
  240. scgi_cache.t
  241. scgi_gzip.t
  242. scgi_merge_params.t
  243. secure_link.t
  244. server_tokens.t
  245. slice.t
  246. split_clients.t
  247. ssi.t
  248. ssi_delayed.t
  249. ssi_if.t
  250. ssi_include_big.t
  251. ssi_waited.t
  252. ssl.t
  253. ssl_certificate.t
  254. ssl_certificate_chain.t
  255. ssl_certificate_perl.t
  256. ssl_certificates.t
  257. ssl_client_escaped_cert.t
  258. ssl_crl.t
  259. ssl_engine_keys.t
  260. ssl_ocsp.t
  261. ssl_password_file.t
  262. ssl_proxy_protocol.t
  263. ssl_proxy_upgrade.t
  264. ssl_sni.t
  265. ssl_sni_reneg.t
  266. ssl_sni_sessions.t
  267. ssl_stapling.t
  268. ssl_verify_client.t
  269. ssl_verify_depth.t
  270. stream_access.t
  271. stream_access_log.t
  272. stream_access_log_escape.t
  273. stream_access_log_none.t
  274. stream_error_log.t
  275. stream_geo.t
  276. stream_geo_binary.t
  277. stream_geo_ipv6.t
  278. stream_geo_unix.t
  279. stream_geoip.t
  280. stream_js.t
  281. stream_js_import.t
  282. stream_js_object.t
  283. stream_js_variables.t
  284. stream_limit_conn.t
  285. stream_limit_conn_complex.t
  286. stream_limit_conn_dry_run.t
  287. stream_limit_rate.t
  288. stream_limit_rate2.t
  289. stream_map.t
  290. stream_proxy.t
  291. stream_proxy_bind.t
  292. stream_proxy_complex.t
  293. stream_proxy_next_upstream.t
  294. stream_proxy_protocol.t
  295. stream_proxy_protocol_ipv6.t
  296. stream_proxy_protocol_ssl.t
  297. stream_proxy_ssl.t
  298. stream_proxy_ssl_certificate.t
  299. stream_proxy_ssl_name.t
  300. stream_proxy_ssl_name_complex.t
  301. stream_proxy_ssl_verify.t
  302. stream_realip.t
  303. stream_realip_hostname.t
  304. stream_resolver.t
  305. stream_split_clients.t
  306. stream_ssl.t
  307. stream_ssl_certificate.t
  308. stream_ssl_preread.t
  309. stream_ssl_preread_alpn.t
  310. stream_ssl_preread_protocol.t
  311. stream_ssl_realip.t
  312. stream_ssl_variables.t
  313. stream_ssl_verify_client.t
  314. stream_status_variable.t
  315. stream_tcp_nodelay.t
  316. stream_udp_limit_conn.t
  317. stream_udp_limit_rate.t
  318. stream_udp_proxy.t
  319. stream_udp_proxy_requests.t
  320. stream_udp_stream.t
  321. stream_udp_upstream.t
  322. stream_udp_upstream_hash.t
  323. stream_udp_upstream_least_conn.t
  324. stream_udp_wildcard.t
  325. stream_unix.t
  326. stream_upstream.t
  327. stream_upstream_hash.t
  328. stream_upstream_least_conn.t
  329. stream_upstream_max_conns.t
  330. stream_upstream_random.t
  331. stream_upstream_zone.t
  332. stream_upstream_zone_ssl.t
  333. stream_variables.t
  334. stub_status.t
  335. sub_filter.t
  336. sub_filter_buffering.t
  337. sub_filter_merge.t
  338. sub_filter_multi.t
  339. sub_filter_multi2.t
  340. sub_filter_perl.t
  341. sub_filter_slice.t
  342. sub_filter_ssi.t
  343. subrequest_output_buffer_size.t
  344. syslog.t
  345. trailers.t
  346. upstream.t
  347. upstream_hash.t
  348. upstream_hash_memcached.t
  349. upstream_ip_hash.t
  350. upstream_ip_hash_ipv6.t
  351. upstream_keepalive.t
  352. upstream_least_conn.t
  353. upstream_max_conns.t
  354. upstream_random.t
  355. upstream_zone.t
  356. upstream_zone_ssl.t
  357. userid.t
  358. uwsgi.t
  359. worker_shutdown_timeout.t
  360. worker_shutdown_timeout_h2.t
  361. worker_shutdown_timeout_mail.t
  362. worker_shutdown_timeout_proxy_upgrade.t
  363. worker_shutdown_timeout_stream.t
  364. xslt.t
  365. xslt_params.t