RESOLVED FIXED Bug 208913
[Curl] Add an API returns description of verification errors.
https://bugs.webkit.org/show_bug.cgi?id=208913
Summary [Curl] Add an API returns description of verification errors.
Takashi Komori
Reported 2020-03-11 05:33:41 PDT
Browser applications can get error code for verification by using WKCertificateInfoGetVerificationError but just displaying error code is inconvinient for users. In this ticket we will add an API to provide error description and make MiniBrowser display error description when it accesses sites which have invalid certs.
Attachments
Patch (11.60 KB, patch)
2020-03-11 06:02 PDT, Takashi Komori
no flags
Patch (11.87 KB, patch)
2020-03-19 04:31 PDT, Takashi Komori
no flags
Takashi Komori
Comment 1 2020-03-11 06:02:52 PDT
Takashi Komori
Comment 2 2020-03-11 06:05:34 PDT
(In reply to Takashi Komori from comment #1) > Created attachment 393229 [details] > Patch Added test only tests the situation the error code is 0 (V509_V_OK). This is because we can't set an arbitrary error code without connecting servers for now. We will improve tests for this patch after establishing a method for testing bad certs in another ticket ( https://bugs.webkit.org/show_bug.cgi?id=208806 ).
Fujii Hironori
Comment 3 2020-03-17 12:34:00 PDT
Comment on attachment 393229 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=393229&action=review > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:369 > + auto certificateInfo = WKProtectionSpaceCopyCertificateInfo(protectionSpace); Don't remove `adoptWK`. It will leak. > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:371 > + auto description = WKCertificateInfoCopyVerificationErrorDescription(certificateInfo); Use adoptWK for the return value of *Copy* API. It will leak. > Tools/TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp:93 > + ASSERT_TRUE(WKStringIsEqualToUTF8CString(WKCertificateInfoCopyVerificationErrorDescription(certificateInfo.get()), "ok")); The return value of WKCertificateInfoCopyVerificationErrorDescription leaks.
Fujii Hironori
Comment 4 2020-03-17 12:34:51 PDT
You added a new WK2 API. Added WK2 owners in CC.
Takashi Komori
Comment 5 2020-03-19 04:31:04 PDT
Takashi Komori
Comment 6 2020-03-19 04:37:17 PDT
(In reply to Fujii Hironori from comment #3) > Comment on attachment 393229 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=393229&action=review > > > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:369 > > + auto certificateInfo = WKProtectionSpaceCopyCertificateInfo(protectionSpace); > > Don't remove `adoptWK`. It will leak. Fixed. > > > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:371 > > + auto description = WKCertificateInfoCopyVerificationErrorDescription(certificateInfo); > > Use adoptWK for the return value of *Copy* API. It will leak. Fixed. > > > Tools/TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp:93 > > + ASSERT_TRUE(WKStringIsEqualToUTF8CString(WKCertificateInfoCopyVerificationErrorDescription(certificateInfo.get()), "ok")); > > The return value of WKCertificateInfoCopyVerificationErrorDescription leaks. Fixed.
youenn fablet
Comment 7 2020-03-19 07:42:37 PDT
New API looks ok to me
EWS
Comment 8 2020-03-19 14:19:01 PDT
Committed r258728: <https://trac.webkit.org/changeset/258728> All reviewed patches have been landed. Closing bug and clearing flags on attachment 393965 [details].
Radar WebKit Bug Importer
Comment 9 2020-03-19 14:20:14 PDT
Note You need to log in before you can comment on or make changes to this bug.