{"id":46457382,"url":"https://github.com/open-coap/kotlin-mbedtls","last_synced_at":"2026-03-06T02:47:31.257Z","repository":{"id":37076952,"uuid":"475045844","full_name":"open-coap/kotlin-mbedtls","owner":"open-coap","description":"Kotlin wrapper of mbedtls also for java","archived":false,"fork":false,"pushed_at":"2026-03-05T11:54:03.000Z","size":16721,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-05T15:42:26.969Z","etag":null,"topics":["cid","dtls","dtls12","iot","java","jvm","kotlin","mbedtls","netty"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-coap.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-28T14:44:32.000Z","updated_at":"2026-03-05T11:54:06.000Z","dependencies_parsed_at":"2024-02-05T07:46:57.889Z","dependency_job_id":"542355b8-3a97-481b-9d06-8fffd68292ef","html_url":"https://github.com/open-coap/kotlin-mbedtls","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/open-coap/kotlin-mbedtls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-coap%2Fkotlin-mbedtls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-coap%2Fkotlin-mbedtls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-coap%2Fkotlin-mbedtls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-coap%2Fkotlin-mbedtls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-coap","download_url":"https://codeload.github.com/open-coap/kotlin-mbedtls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-coap%2Fkotlin-mbedtls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30159969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cid","dtls","dtls12","iot","java","jvm","kotlin","mbedtls","netty"],"created_at":"2026-03-06T02:47:30.619Z","updated_at":"2026-03-06T02:47:31.245Z","avatar_url":"https://github.com/open-coap.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"Kotlin + mbedtls integration\n==========================\n\n\n![Maven Central](https://img.shields.io/maven-central/v/io.github.open-coap/kotlin-mbedtls)\n[![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](LICENSE)\n\nIntegration with mbedtls library to provide DTLS protocol into jvm ecosystem.\n\n## Features:\n\n- Precompiled mbedtls binaries for\n  - linux (x64)\n  - macos (intel and arm)\n  - windows (x64)\n- DTLS 1.2 client and server modes\n- DTLS 1.2 CID support (RFC 9146)\n  - Storing and restoring sessions\n- Certificate and PSK authentication\n- Micrometer integration\n- Netty integration (client and server)\n\n## Usage:\n\n**Gradle**\n\n```kotlin\ndependencies {\n  implementation(\"io.github.open-coap:kotlin-mbedtls:[VERSION]\")\n  // optional modules:\n  implementation(\"io.github.open-coap:kotlin-mbedtls-metrics:[VERSION]\")\n  implementation(\"io.github.open-coap:kotlin-mbedtls-netty:[VERSION]\")\n}\n```\n\n**Maven**\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.open-coap\u003c/groupId\u003e\n    \u003cartifactId\u003ekotlin-mbedtls\u003c/artifactId\u003e\n    \u003cversion\u003e[VERSION]\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nDTLS client:\n\n```kotlin\n// create mbedtls SSL configuration with PSK credentials\nval conf: SslConfig = SslConfig.client(\n    PskAuth(\n        pskId = \"device-007\",\n        pskSecret = byteArrayOf(0x01, 0x02)\n    )\n)\n// create client and initiate handshake\nval client: DtlsTransmitter = DtlsTransmitter\n    .connect(InetSocketAddress(InetAddress.getLocalHost(), 1_5684), conf, 6001)\n    .get(10, TimeUnit.SECONDS)\n\n// send and receive packets\nval sendResult: CompletableFuture\u003cBoolean\u003e = client.send(\"hello\")\nval receive: CompletableFuture\u003cByteBuffer\u003e = client.receive(timeout = Duration.ofSeconds(2))\n\n// . . . \n\n// optionally, it is possible to save session before closing client, it could be later reloaded\n// note: after saving session, it is not possible to is client\nval storedSession: ByteArray = client.saveSession()\nclient.close()\n\n// close SSL configuration:\n// - make sure to close it before GC to avoid native memory leak\n// - close it only after client is closed\nconf.close()\n```\n\n## Supported OS\n\nPrecompiled:\n\n- Linux (x86-64)\n- Apple Mac (intel and arm)\n- Windows (x86-64)\n\n## Development\n\n### Useful commands\n\n- `./gradlew build -i`             compile and test\n- `./gradlew publishToMavenLocal`  publish artifact to local maven repository\n- `./gradlew currentVersion`       show current version\n- `./gradlew ktlintFormat`         format kotlin files\n\n- `./gradlew release`              create next tag in Git and push to origin\n- `./gradlew currentVersion`       print current version\n- `./gradlew dependencyUpdates`    determine which dependencies have updates\n- `./gradlew useLatestVersions`    update dependencies to the latest available versions\n- `./gradlew jmh`                  run benchmarks\n- `./gradlew :kotlin-mbedtls:jmh -PjmhIncludes=benchmark.SslContextBenchmark.handshake_cert_ecdhe_ecdsa_with_aes_128_gcm` run specific benchmark\n\n### Build mbedtls binaries\n\nLinux (x86_64):\n\n`./compileMbedtls.sh`\n\nMac (intel and arm):\n\n`DLEXT=dylib OSARCH=darwin CMAKE_EXTRA='-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' ./compileMbedtls.sh`\n\nWindows\n\n- `docker run -it -v$(pwd):/work --rm dockcross/windows-static-x64 \\\n    sh -c \"apt-get update \u0026\u0026 apt-get install -y python3-venv \u0026\u0026 \\\n    WINDOWS=1 \\\n    CMAKE_EXTRA='-DCMAKE_C_FLAGS=-D__USE_MINGW_ANSI_STDIO=0' \\\n    DLEXT=dll \\\n    OSARCH=win32-x86-64 \\\n    ./compileMbedtls.sh\"`\n\nCross compiling for linux (x86_64):\n\n- `docker run -it -v$(pwd):/work --rm dockcross/linux-x86_64-full ./compileMbedtls.sh`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-coap%2Fkotlin-mbedtls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-coap%2Fkotlin-mbedtls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-coap%2Fkotlin-mbedtls/lists"}