Skip to content

Commit

Permalink
Fix fatal TLS handshake exception when publishing
Browse files Browse the repository at this point in the history
The Ktor HTTP client throws a fatal TLSException HandshakeFailure when
connecting to the repository. Curiously this doesn't occur in our
staging environment, but can easily be reproduced locally.

The issue seems to find root in the CIO Ktor client's cipher support
suite as indicated by issues with the same error such as [1]. Supposedly
this issue was resolved, but others such as [2] indicate the issue is
still present despite it being closed upstream. Without useful error
information from the stack trace, the best option seems to be switching
to another well-supported client engine such as Apache5. As a bonus,
Apache5 also has HTTP/2 enabled by default.

[1]: ktorio/ktor#439
[2]: oliver-charlesworth/craft-watch#198
  • Loading branch information
lberrymage committed Nov 10, 2023
1 parent 1b0649c commit 52ce77f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion console/build.gradle.kts
Expand Up @@ -77,7 +77,7 @@ dependencies {
implementation("cc.ekblad:4koma:$fourkomaVersion")
implementation("io.insert-koin:koin-ktor:$koinVersion")
implementation("io.insert-koin:koin-logger-slf4j:$koinVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-apache5:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
Expand Down
68 changes: 68 additions & 0 deletions gradle/verification-metadata.xml
Expand Up @@ -889,6 +889,22 @@ SPDX-License-Identifier: AGPL-3.0-only
<sha256 value="cb9781793d3e25f5442fca0f8d050d1f152489184467cb3160e34d23105208b8" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.ktor" name="ktor-client-apache5" version="2.3.6">
<artifact name="ktor-client-apache5-2.3.6.module">
<sha256 value="b533ef00de21795db41ba90ff9a91fee08ebe5badfce2ec399ad360a13481dfc" origin="Generated by Gradle"/>
</artifact>
<artifact name="ktor-client-apache5-metadata-2.3.6.jar">
<sha256 value="5a46fdbc40fd2d78259883c4cc6eaf3b5e290dd07d1c46ea88eea3d48f505772" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.ktor" name="ktor-client-apache5-jvm" version="2.3.6">
<artifact name="ktor-client-apache5-jvm-2.3.6.jar">
<sha256 value="3f384c0c68522ef46a20129a400e2db238ad479df2395f213e4f26758025251a" origin="Generated by Gradle"/>
</artifact>
<artifact name="ktor-client-apache5-jvm-2.3.6.module">
<sha256 value="b267b215fb383e74348dbafa955db4f1a112235440d5a98434a47ec740677381" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.ktor" name="ktor-client-cio" version="2.3.6">
<artifact name="ktor-client-cio-2.3.6.module">
<sha256 value="7a500510bca1e2da4515b2d13beb85407460cbc99fe56b9b106e63e862f07d67" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1868,6 +1884,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<sha256 value="bc10624e0623f36577fac5639ca2936d3240ed152fb6d8d533ab4d270543491c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache" name="apache" version="27">
<artifact name="apache-27.pom">
<sha256 value="b2b0fc69e22a650c3892f1c366d77076f29575c6738df4c7a70a44844484cdf9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.ant" name="ant" version="1.10.11">
<artifact name="ant-1.10.11.jar">
<sha256 value="88c0b89bbbaae01e0d9fcae93be792f5abbe3409106f8eee858fdf365dbc0754" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1984,6 +2005,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<sha256 value="a901f87b115c55070c7ee43efff63e20e7b02d30af2443ae292bf1f4e532d3aa" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.httpcomponents" name="httpcomponents-parent" version="13">
<artifact name="httpcomponents-parent-13.pom">
<sha256 value="e4287867035856c737420368dd586e5e57e702098135840cf3d73e9c8363d7b3" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.httpcomponents" name="httpcore" version="4.4.15">
<artifact name="httpcore-4.4.15.jar">
<sha256 value="3cbaed088c499a10f96dde58f39dc0e7985171abd88138ca1655a872011bb142" origin="Generated by Gradle"/>
Expand All @@ -2008,6 +2034,40 @@ SPDX-License-Identifier: AGPL-3.0-only
<sha256 value="dfbfd6ffe2a784ca9817c46365aa7f8a578320b805bde39d6f55a0b09d8aa8ca" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.httpcomponents.client5" name="httpclient5" version="5.2.1">
<artifact name="httpclient5-5.2.1.jar">
<sha256 value="9355f3876baf82fec13ced22c12b62d57536230836406d359459128e4f73ed51" origin="Generated by Gradle"/>
</artifact>
<artifact name="httpclient5-5.2.1.pom">
<sha256 value="465b0d6a346649db37485b0fa660621b4a8df900863fa198709f198d547e1bdb" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.httpcomponents.client5" name="httpclient5-parent" version="5.2.1">
<artifact name="httpclient5-parent-5.2.1.pom">
<sha256 value="0e1eaef101f0459129f47125b0bd94a5839b9f54d82b2c5f3551a57ccef85641" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.httpcomponents.core5" name="httpcore5" version="5.2">
<artifact name="httpcore5-5.2.jar">
<sha256 value="293321cbf594d79ea8a0cb0214f75f146d17f088be17ad5ce11c2fe864df124c" origin="Generated by Gradle"/>
</artifact>
<artifact name="httpcore5-5.2.pom">
<sha256 value="107a8cb10b5ce404464eafc1f67b1c132f068310f30b86d8a4c0a44da9057f25" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.httpcomponents.core5" name="httpcore5-h2" version="5.2">
<artifact name="httpcore5-h2-5.2.jar">
<sha256 value="5a087fb8c619979d492a83546f351ddadf32b28cc6a32923229f3fc777171578" origin="Generated by Gradle"/>
</artifact>
<artifact name="httpcore5-h2-5.2.pom">
<sha256 value="59d0eee64fcc3f4549a8ba1e0c99da125f46421c68fc63ecca72fc8f6f2c3ee2" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.httpcomponents.core5" name="httpcore5-parent" version="5.2">
<artifact name="httpcore5-parent-5.2.pom">
<sha256 value="d7f7efec609e0fdd7e3ae6eb3a550058e6f93e5d2c2424d74b21de8f7536f750" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.logging" name="logging-parent" version="3">
<artifact name="logging-parent-3.pom">
<sha256 value="763a2ec2b8094d4161deb6c264b1262085b9be30bf3a31c2ce137242e57722a7" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -2816,6 +2876,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<sha256 value="d83e87f1676cde44191eec5cda690492392f26923b1e498148ca739dfed75295" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="5.9.1">
<artifact name="junit-bom-5.9.1.module">
<sha256 value="9026c1656690fa145ad75ece83674211aa12ad8930a91b107c2f5cdece2f1b1c" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.9.1.pom">
<sha256 value="b163c1cfc8fc1fd58b457a00d586c04c46e986d75904e9ca54c03a97d65b496c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="5.9.2">
<artifact name="junit-bom-5.9.2.module">
<sha256 value="ab137ba5a8e32c9b066bf9126a1c76dd5614b724ba5c0b02549772b5e9f4cf1f" origin="Generated by Gradle"/>
Expand Down

0 comments on commit 52ce77f

Please sign in to comment.