Project

General

Profile

Actions

Feature #101935

open

Better handling of curl error codes in linkvalidator

Added by Sybille Peters about 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Should have
Category:
Linkvalidator
Target version:
-
Start date:
2023-09-17
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Unfortunately, one curl error codes may be used for several different problems, e.g.

1. Certificate does not have matching target host name
2. Missing intermediate certificate - incomplete certificate chain

The text which is displayed by command line curl / or using Guzzle with libcurl does contain a different text in this case, but the error code is still the same (60 for the examples above).

A number of error codes were localized and the internal linkvalidator text is displayed, not the full error message supplied by curl.

Solution

(preliminary ideas)

  • We should find a way to make this configurable, so that the full curl error message will be displayed
  • show both (e.g. show shorter, localized message by default and show full message as detail view

Info

Examples

curl -LI "https://www.rea.ru" 
curl: (60) SSL certificate problem: unable to get local issuer certificate
curl -I https://t3coredev13
curl: (60) SSL: no alternative certificate subject name matches target host name 't3coredev13'
Actions #1

Updated by Sybille Peters about 1 year ago

e.g. for curl code 60, Guzzle / curl returns another code in ssl_verify_result:

handlerContext
errno=60
error="SSL certificate problem: unable to get local issuer certificate" 
ssl_verify_result=20

-----

errno=60
"SSL: no alternative certificate subject name matches target host name 't3coredev13'" 
ssl_verify_result=1

-----

This matches the lists (e.g. for code 20):

see also "Everything curl" by curl author: https://github.com/bagder/everything-curl

Actions

Also available in: Atom PDF