Skip to content

Upgrading io.ktor:ktor-client-core 2 to 3

Breaking2.3.13 → 3.6.1Breaking11Security4Deprecated10New142Changed84Fixed520Other17

BreakingUpgrade verdict

11 breaking changes and 4 security fixes.

  • Projects that referenced the old shared JavaScript/Wasm target name must switch to the new name.
  • Authentication no longer requires certain marker interfaces, which may affect code relying on them.
  • Previously deprecated APIs are removed, so code still using them will no longer compile.
  • A function that reads a line now reports how many bytes it read rather than how many characters.
Top 5 of 25 that need code or config changes

Adds io.ktor:ktor-http-cio 3.6.1, io.ktor:ktor-sse 3.6.1, org.jetbrains.kotlin:kotlin-stdlib 2.3.21.

Drops org.jetbrains.kotlin:kotlin-stdlib-common, org.jetbrains.kotlinx:atomicfu.

Installs 17 packages in all (was 16).

Also installs org.jetbrains.kotlinx:kotlinx-io-bytestring, org.jetbrains.kotlinx:kotlinx-io-core, org.jetbrains.kotlinx:kotlinx-serialization-core, org.jetbrains.kotlinx:kotlinx-serialization-core-jvm.

No longer installs org.jetbrains.kotlin:kotlin-stdlib-jdk7, org.jetbrains.kotlin:kotlin-stdlib-jdk8, org.jetbrains.kotlinx:atomicfu-jvm.

Moves org.jetbrains.kotlin:kotlin-stdlib 1.8.0 → 2.3.21, org.jetbrains.kotlinx:kotlinx-coroutines-core 1.7.1 → 1.11.0, org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm 1.7.1 → 1.11.0, org.jetbrains:annotations 23.0.0 → 13.0. Your build may pick other versions.

7 packages of its own release move with it.

Breaking11
Renames the jsAndWasmShared target to web.
jsAndWasmSharedweb
Auth drops marker interface requirements.
Drops old deprecations.
ByteReadChannel.readLineTo now returns the count of read bytes instead of decoded characters.
ByteReadChannel.readLineTo
Makes DynamicProviderConfig.authenticateFunction suspend.
DynamicProviderConfig.authenticateFunction
Redesigns the ByteReadChannel.readUTF8Line API.
ByteReadChannel.readUTF8Line
Makes readUTF8LineTo return the number of read symbols instead of a boolean.
readUTF8LineTo
Deprecates withTestApplication APIs with ERROR level and migrates to testApplication.
withTestApplicationtestApplication
Replaces java.time options in the Websockets plugin.
Stops publishing an empty io.ktor:ktor Maven artifact.
io.ktor:ktor
Makes LDAP Auth return a generic Principal instead of UserIdPrincipal.
PrincipalUserIdPrincipal
Security4
Fixes infinite spin and potential OOM vulnerabilities in WebSockets Inflater.inflateFully.
Inflater.inflateFully
Fixes MicrometerMetrics OOM abuse via 404 requests with different paths.
MicrometerMetrics
Addresses the weak MD5 security algorithm used in FileCacheStorage.
FileCacheStorage
Fixes a denial-of-service via out-of-memory caused by unbound request body size.
Deprecated10
Deprecates HttpHeaders.AcceptCharset.
HttpHeaders.AcceptCharset
Improves the deprecation notice for io.ktor.server.auth.Principal to explain what to use instead.
io.ktor.server.auth.Principal
Deprecates the DarwinLegacy engine.
DarwinLegacy
Deprecates the Apache 4 engine.
Deprecates the var Route.staticRootFolder: File? property.
Route.staticRootFolder
Deprecates HttpClientCall.wrapWithContent and HttpClientCall.wrap.
HttpClientCall.wrapWithContentHttpClientCall.wrap
Deprecates SaveBodyPlugin in favor of HttpClientCall.save.
SaveBodyPluginHttpClientCall.save
Deprecates old jetty, tomcat and servlet engines.
Deprecates Locations with Level.ERROR.
LocationsLevel.ERROR
Adds deprecations for the old IO API.