-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add HTTP engine config for min TLS version #844
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dead3d5
feat: add HTTP engine config for min TLS version
ianbotsf 90c905f
add missing KDocs; remove unnecessary coroutines dependency
ianbotsf db5e0cd
refactor TLS min version into TlsContext in generic config; remove en…
ianbotsf c8085c7
clarify that change is breaking
ianbotsf 628173d
Merge branch 'main' into feat-min-tls-version
ianbotsf 2859243
add link to BREAKING post
ianbotsf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id": "1af71df0-f584-493e-85ab-2ee3e853c827", | ||
"type": "feature", | ||
"description": "**Breaking**: Add HTTP engine configuration for minimum TLS version", | ||
"issues": [ | ||
"awslabs/smithy-kotlin#661" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...ient-engines/test-suite/common/test/aws/smithy/kotlin/runtime/http/test/ConnectionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package aws.smithy.kotlin.runtime.http.test | ||
|
||
// TODO Finish once we have HTTP engine support for client certificates | ||
/* | ||
private const val TLS1_0_URL = "https://localhost:${TestServer.TlsV1.port}/" | ||
private const val TLS1_1_URL = "https://localhost:${TestServer.TlsV1_1.port}/" | ||
private const val TLS1_2_URL = "https://localhost:${TestServer.TlsV1_2.port}/" | ||
private const val TLS1_3_URL = "https://localhost:${TestServer.TlsV1_3.port}/" | ||
|
||
class ConnectionTest : AbstractEngineTest() { | ||
private fun testMinTlsVersion(version: TlsVersion, failUrl: String?, succeedUrl: String) { | ||
testEngines { | ||
engineConfig { | ||
minTlsVersion = version | ||
} | ||
|
||
failUrl?.let { | ||
test { env, client -> | ||
val req = HttpRequest { | ||
testSetup(env) | ||
url(Url.parse(failUrl)) | ||
} | ||
|
||
val call = client.call(req) | ||
call.complete() | ||
assertEquals(HttpStatusCode.UpgradeRequired, call.response.status) | ||
} | ||
} | ||
|
||
test { env, client -> | ||
val req = HttpRequest { | ||
testSetup(env) | ||
url(Url.parse(succeedUrl)) | ||
} | ||
|
||
val call = client.call(req) | ||
call.complete() | ||
assertEquals(HttpStatusCode.OK, call.response.status) | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun testMinTls1_0() = testMinTlsVersion(TlsVersion.Tls1_0, null, TLS1_0_URL) | ||
|
||
@Test | ||
fun testMinTls1_1() = testMinTlsVersion(TlsVersion.Tls1_1, TLS1_0_URL, TLS1_1_URL) | ||
|
||
@Test | ||
fun testMinTls1_2() = testMinTlsVersion(TlsVersion.Tls1_2, TLS1_1_URL, TLS1_2_URL) | ||
|
||
@Test | ||
fun testMinTls1_3() = testMinTlsVersion(TlsVersion.Tls1_3, TLS1_2_URL, TLS1_3_URL) | ||
} | ||
*/ |
17 changes: 17 additions & 0 deletions
17
...l/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Tls.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package aws.smithy.kotlin.runtime.http.test.suite | ||
|
||
import io.ktor.server.application.* | ||
import io.ktor.server.response.* | ||
import io.ktor.server.routing.* | ||
|
||
internal fun Application.tlsTests() { | ||
routing { | ||
get("/tlsVerification") { | ||
call.respondText("OK") | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note to the TLS configuration issue to finish this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added note to #820.