Swift SSL error names the host "unknown host" for some addresses
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, networking
Research direction
Read native/swift/Sources/wordpress-api/SafeRequestExecutor.swift around line 218 and compare its host lookup with buildURLRequest and wpEndpointUrlRfc3986(url:), referenced in the issue as the approach used since #1746. Check how percent escapes should be decoded for display. Done means the certificate mismatch error names affected hosts instead of showing "unknown host".
Written by the indexing model from the issue text.
Description
The Swift executor's certificate-mismatch error can name the host as "unknown host".
What happens
The SSL error handler in native/swift/Sources/wordpress-api/SafeRequestExecutor.swift (around line 218) reads the host with URL(string: request.url())?.host ?? "unknown host". It uses the unencoded address, which URL(string:) rejects for a host containing {, }, " or ` on every OS version, and for | or ^ anywhere before iOS 17 and macOS 14.
Who is affected
Only the wording of a CertificateNotValidForName error for those addresses. It can't crash.
Suggested fix
Read the host from the RFC 3986 form, as buildURLRequest does since #1746 (wpEndpointUrlRfc3986(url:)), and decode its percent escapes for display.
- Dominant language
- Rust
- Stars
- 38
- Forks
- 6
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 50
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/wordpress-rs
-
Bug Error Handling Kotlin
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/wordpress-rs#1758 ·
Maintainers usually reply within 1 day
-
Bug Login Rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/wordpress-rs#1757 ·
Maintainers usually reply within 1 day
-
Expose modified_gmt on PostMetadataCollectionItemPossibly taken @winshaurya claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Automattic/wordpress-rs#1690 · 1 comment ·
Maintainers usually reply within 1 day
-
Bug Kotlin
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/wordpress-rs#1625 · 1 comment ·
Maintainers usually reply within 1 day
-
The offline, cancelled, and generic-fallback branches hardcode `redirects: nil`Possibly taken @jkmassel claimed this 50 days ago. OpenBug Error Handling Swift
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/wordpress-rs#1520 ·
Maintainers usually reply within 1 day
All issues in Automattic/wordpress-rs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-telemetry/weaver#1917 ·
Maintainers usually reply within 2 days
-
bug host P3 web
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jphacks/kz_2613#589 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation pkg:sdk project
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
priority middle
Difficulty 1/5 Under an hour Newbie friendliness 72/100
KATO-Hiro/AtCoderClans#13029 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
RustCrypto/formats#2544 ·
Maintainers usually reply within 1 day