{"id":16607464,"url":"https://github.com/mitchcapper/libhsts","last_synced_at":"2026-04-17T20:31:41.292Z","repository":{"id":236631734,"uuid":"652561884","full_name":"mitchcapper/libhsts","owner":"mitchcapper","description":"Mirror of https://gitlab.com/rockdaboot/libhsts","archived":false,"fork":false,"pushed_at":"2023-07-26T07:51:17.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T01:46:57.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitchcapper.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-12T10:21:58.000Z","updated_at":"2023-06-12T10:22:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"f30e07d5-0460-4b9a-9017-e66a1d6e5be2","html_url":"https://github.com/mitchcapper/libhsts","commit_stats":null,"previous_names":["mitchcapper/libhsts"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mitchcapper/libhsts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchcapper%2Flibhsts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchcapper%2Flibhsts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchcapper%2Flibhsts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchcapper%2Flibhsts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchcapper","download_url":"https://codeload.github.com/mitchcapper/libhsts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchcapper%2Flibhsts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31944963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-12T01:13:44.198Z","updated_at":"2026-04-17T20:31:41.271Z","avatar_url":"https://github.com/mitchcapper.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://gitlab.com/rockdaboot/libhsts/badges/master/build.svg)](https://gitlab.com/rockdaboot/libhsts/pipelines)\n[![Coverage status](https://gitlab.com/rockdaboot/libhsts/badges/master/coverage.svg)](https://rockdaboot.gitlab.io/libhsts/coverage)\n\nlibhsts - C library to access the HSTS preload list\n===================================================\n\nThe HSTS preload list is a list of domains that support HTTPS.\nThe list is compiled by Google and is utilised by Chrome, Firefox and others.\n\nWith this information, a HTTP client may contact a website without trying\na plain-text HTTP connection first. It prevents interception with redirects\nthat take place over HTTP. None of the sent data will ever be unencrypted.\n\nA good explananation of HSTS and HSTS preloading has been written by\n[Scott Helme - HSTS Preloading](https://scotthelme.co.uk/hsts-preloading/).\n\nThe DAFSA code has been taken from [Chromium Project](https://code.google.com/p/chromium/).\n\n\nAPI Documentation\n-----------------\n\nYou find the current API documentation [here](https://rockdaboot.gitlab.io/libhsts/reference/).\n\n\nQuick API example\n-----------------\n\n\t#include \u003cstdio.h\u003e\n\t#include \u003clibhsts.h\u003e\n\n\tint main(void)\n\t{\n\t\tconst char *domain = \"example.com\";\n\t\thsts_t *hsts;\n\n\t\tif (hsts_load_file(SRCDIR \"/hsts.dafsa\", \u0026hsts) == HSTS_SUCCESS) {\n\t\t\thsts_entry_t *e;\n\n\t\t\tif (hsts_search(hsts, domain, 0, \u0026e) == HSTS_SUCCESS)\n\t\t\t\tprintf(\"%s is in the HSTS preload list\\n\", domain);\n\t\t\telse\n\t\t\t\tprintf(\"Failed to find %s in the HSTS preload list\\n\", domain);\n\t\t}\n\t\thsts_free(hsts);\n\n\t\treturn 0;\n\t}\n\nCommand Line Tool\n-----------------\n\nLibhsts comes with a tool 'hsts' that gives you access to most of the\nlibrary API via command line.\n\n\t$ hsts --help\n\nprints the usage.\n\nConvert HSTS into DAFSA\n-----------------------\n\nThe [DAFSA](https://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton) format is a compressed\nrepresentation of strings. Here we use it to reduce the whole HSTS to about 350k in size.\n\nThe current HSTS Preload list can be retrieved, prepared and generated with:\n\n\t$ wget 'https://raw.github.com/chromium/chromium/master/net/http/transport_security_state_static.json'\n\n\t$ sed 's/^ *\\/\\/.*$//g' transport_security_state_static.json \u003ehsts.json\n\n\t$ src/hsts-make-dafsa --output-format=binary hsts.json hsts.dafsa\n\nTest the result (example)\n\n\t$ tools/hsts --load-hsts-file hsts.dafsa example.com\n\nLicense\n-------\n\nLibhsts is made available under the terms of the MIT license.\u003cbr\u003e\nSee the LICENSE file that accompanies this distribution for the full text of the license.\n\nsrc/hsts-make-dafsa and src/lookup_string_in_fixed_set.c are licensed under the term written in\nsrc/LICENSE.chromium.\n\nBuilding from git\n-----------------\n\nYou should have python2.7+ installed.\n\nDownload project and prepare sources with\n\n\t\tgit clone https://gitlab.com/rockdaboot/libhsts\n\t\tautoreconf -fi\n\t\t./configure\n\t\tmake\n\t\tmake check\n\nIf you see errors about AX_CHECK_COMPILE_FLAG during `./configure`,\nmake sure you have the autoconf-archive installed.\n\nE.g. on Debian via `apt-get install autoconf-archive`.\n\nMailing List\n------------\n\n[Mailing List Archive](http://news.gmane.org/gmane.network.dns.libhsts.bugs)\n\n[Mailing List](https://groups.google.com/forum/#!forum/libhsts-bugs)\n\nTo join the mailing list send an email to\n\nlibhsts-bugs+subscribe@googlegroups.com\n\nand follow the instructions provided by the answer mail.\n\nOr click [join](https://groups.google.com/forum/#!forum/libhsts-bugs/join).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchcapper%2Flibhsts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchcapper%2Flibhsts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchcapper%2Flibhsts/lists"}