Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amesgen/hs-rustls
Haskell bindings to Rustls
https://github.com/amesgen/hs-rustls
haskell http rust rustls tls
Last synced: about 1 month ago
JSON representation
Haskell bindings to Rustls
- Host: GitHub
- URL: https://github.com/amesgen/hs-rustls
- Owner: amesgen
- Created: 2022-06-24T18:14:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T19:24:39.000Z (7 months ago)
- Last Synced: 2024-04-14T09:52:29.485Z (7 months ago)
- Topics: haskell, http, rust, rustls, tls
- Language: Haskell
- Homepage:
- Size: 111 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hs-rustls — Rustls for Haskell
[![CI](https://github.com/amesgen/hs-rustls/workflows/CI/badge.svg)](https://github.com/amesgen/hs-rustls/actions)
[![Hackage](https://img.shields.io/hackage/v/rustls)](https://hackage.haskell.org/package/rustls)Haskell bindings for the [Rustls](https://github.com/rustls/rustls) TLS library via [rustls-ffi](https://github.com/rustls/rustls-ffi).
See [the haddocks](https://hackage.haskell.org/package/rustls/docs/Rustls.html) for documentation.
Also see:
- [http-client-rustls](/http-client-rustls): Make HTTPS requests using [http-client](https://hackage.haskell.org/package/http-client) and Rustls.
## Development
### With Nix
When developing this library, just drop into a Nix shell.
If you want to depend on this library in another package, you have to make sure to include rustls-ffi as a native dependency. You can do so by depending on the `github:amesgen/hs-rustls?dir=nix-rustls` flake, and then using the `nix-rustls.packages.${system}.default` output.
### Without Nix
#### rustls-ffi
Make sure to have [Cargo](https://doc.rust-lang.org/stable/cargo/getting-started/installation.html) installed. Then, clone and install rustls-ffi:
```bash
git clone https://github.com/rustls/rustls-ffi -b v0.14.0
cd rustls-ffi
make DESTDIR=/path/to/some/dir install
```Then, in a `cabal.project.local`, add these lines:
```cabal
extra-include-dirs: /path/to/some/dir/include
extra-lib-dirs: /path/to/some/dir/lib
```With this, Cabal should be able to find the rustls-ffi native library.
> Note: This process might become less manual if sth like [haskell/cabal#7906](https://github.com/haskell/cabal/issues/7906) lands in Cabal.
#### Testing
When running the tests in this repo, you have to have [minica](https://github.com/jsha/minica) and [miniserve](https://github.com/svenstaro/miniserve) installed.