{"id":19492763,"url":"https://github.com/oatpp/oatpp-mbedtls","last_synced_at":"2025-04-25T20:30:28.038Z","repository":{"id":41989786,"uuid":"188333329","full_name":"oatpp/oatpp-mbedtls","owner":"oatpp","description":"Client/Server Secure ConnectionProvider for oatpp applications. Based on MbedTLS.","archived":false,"fork":false,"pushed_at":"2024-05-25T05:58:15.000Z","size":162,"stargazers_count":7,"open_issues_count":5,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-21T03:27:01.218Z","etag":null,"topics":["cpp","mbedtls","oatpp","tls"],"latest_commit_sha":null,"homepage":"https://oatpp.io/","language":"C++","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/oatpp.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}},"created_at":"2019-05-24T01:45:39.000Z","updated_at":"2023-12-08T23:05:20.000Z","dependencies_parsed_at":"2024-11-07T00:32:33.350Z","dependency_job_id":"1cd6e374-b975-410e-a488-f66927f78cf0","html_url":"https://github.com/oatpp/oatpp-mbedtls","commit_stats":{"total_commits":58,"total_committers":6,"mean_commits":9.666666666666666,"dds":"0.12068965517241381","last_synced_commit":"1077a280efbf7a404b7629e49e4370c620940725"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-mbedtls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-mbedtls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-mbedtls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-mbedtls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oatpp","download_url":"https://codeload.github.com/oatpp/oatpp-mbedtls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250822970,"owners_count":21492979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp","mbedtls","oatpp","tls"],"created_at":"2024-11-10T21:22:56.901Z","updated_at":"2025-04-25T20:30:27.999Z","avatar_url":"https://github.com/oatpp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oatpp-mbedtls [![Build Status](https://dev.azure.com/lganzzzo/lganzzzo/_apis/build/status/oatpp.oatpp-mbedtls?branchName=master)](https://dev.azure.com/lganzzzo/lganzzzo/_build/latest?definitionId=18\u0026branchName=master)\n\n**oatpp-mbedtls** - extension for [Oat++ Web Framework](https://github.com/oatpp/oatpp).  \nIt provides secure server and client connection providers for oatpp applications. Based on [MbedTLS](https://tls.mbed.org/).  \nSupports both \"Simple\" and \"Async\" oatpp APIs.\n\nSee more:\n- [Oat++ Website](https://oatpp.io/)\n- [Oat++ Github Repository](https://github.com/oatpp/oatpp)\n- [MbedTLS](https://tls.mbed.org/)\n\n## How To Build\n\n### Requires\n\n- MbedTLS installed.\n\n#### Install MbedTLS from source\n\n```bash\ngit clone -b 'mbedtls-2.16.1' --single-branch --depth 1 --recurse-submodules https://github.com/ARMmbed/mbedtls\n\ncd mbedtls\nmkdir build \u0026\u0026 cd build\n\ncmake ..\nmake install\n```\n\n#### Install MbedTLS to a custom location\n\n```bash\ngit clone -b 'mbedtls-2.16.1' --single-branch --depth 1 --recurse-submodules https://github.com/ARMmbed/mbedtls\n\ncd mbedtls\nmkdir build \u0026\u0026 cd build\n\ncmake -DCMAKE_INSTALL_PREFIX:PATH=/my/custom/location ..\nmake install\n```\n\n### Build And Install oatpp-mbedtls\n\nIf mbedtls was installed to a standard location:\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake install\n```\n\nIf mbedtls was installed to a custom location:\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake -DMBEDTLS_ROOT_DIR=/my/custom/location ..\nmake install\n```\n\n## APIs\n\n### Server\n\n#### ConnectionProvider\n\nCreate `ConnectionProvider`\n\n```cpp\nconst char* serverCertificateFile = \"path/to/server/certificate\";\nconst char* serverPrivateKeyFile = \"path/to/server/private/key\";\n\n/* Create Config */\nauto config = oatpp::mbedtls::Config::createDefaultServerConfigShared(serverCertificateFile, serverPrivateKeyFile);\n\n/* Create Secure Connection Provider */\nauto connectionProvider = oatpp::mbedtls::server::ConnectionProvider::createShared(config, {\"localhost\" /* host */, 443 /* port */});\n\n/* Get Secure Connection Stream */\nauto connection = connectionProvider-\u003egetConnection();\n```\n\n#### Custom Transport Stream\n\nCreate `ConnectionProvider` with custom transport stream.\n\n```cpp\nconst char* serverCertificateFile = \"path/to/server/certificate\";\nconst char* serverPrivateKeyFile = \"path/to/server/private/key\";\n\n/* Create Config */\nauto config = oatpp::mbedtls::Config::createDefaultServerConfigShared(serverCertificateFile, serverPrivateKeyFile);\n\n/* Create Transport Stream Provider */\n/* Replace With Your Custom Transport Stream Provider */\nauto transportStreamProvider = oatpp::network::tcp::server::ConnectionProvider::createShared({\"localhost\" /* host */, 443 /* port */});\n\n/* Create Secure Connection Provider */\nauto connectionProvider = oatpp::mbedtls::server::ConnectionProvider::createShared(config, transportStreamProvider);\n\n/* Get Secure Connection Stream over Custom Transport Stream */\nauto connection = connectionProvider-\u003egetConnection();\n```\n\n**Note:** To use `oatpp-mbedtls` for server connections with custom transport stream you should implement:\n\n- [oatpp::network::ServerConnectionProvider](https://oatpp.io/api/latest/oatpp/network/ConnectionProvider/#serverconnectionprovider).\n- [oatpp::data::stream::IOStream](https://oatpp.io/api/latest/oatpp/core/data/stream/Stream/#iostream) - to be returned by `ConnectionProvider`.\n\n### Client\n\n#### ConnectionProvider\n\nCreate `ConnectionProvider`\n\n```cpp\n/* Create Config */\nauto config = oatpp::mbedtls::Config::createDefaultClientConfigShared();\n\n/* Create Secure Connection Provider */\nauto connectionProvider = oatpp::mbedtls::client::ConnectionProvider::createShared(config, {\"httpbin.org\", 443 /* port */});\n\n/* Get Secure Connection Stream */\nauto connection = connectionProvider-\u003egetConnection();\n```\n\n#### Custom Transport Stream\n\nCreate `ConnectionProvider` with custom transport stream.\n\n```cpp\n/* Create Config */\nauto config = oatpp::mbedtls::Config::createDefaultClientConfigShared();\n\n/* Create Transport Stream Provider */\n/* Replace With Your Custom Transport Stream Provider */\nauto transportStreamProvider = oatpp::network::client::SimpleTCPConnectionProvider::createShared({\"httpbin.org\", 443 /* port */});\n\n/* Create Secure Connection Provider */\nauto connectionProvider = oatpp::mbedtls::client::ConnectionProvider::createShared(config, transportStreamProvider);\n\n/* Get Secure Connection Stream over Custom Transport Stream */\nauto connection = connectionProvider-\u003egetConnection();\n```\n\n**Note:** To use `oatpp-mbedtls` for client connections with custom transport stream you should implement:\n\n- [oatpp::network::ClientConnectionProvider](https://oatpp.io/api/latest/oatpp/network/ConnectionProvider/#clientconnectionprovider).\n- [oatpp::data::stream::IOStream](https://oatpp.io/api/latest/oatpp/core/data/stream/Stream/#iostream) - to be returned by `ConnectionProvider`.\n\n\n## See more\n\n- [oatpp-libressl](https://github.com/oatpp/oatpp-libressl)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-mbedtls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foatpp%2Foatpp-mbedtls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-mbedtls/lists"}