https://github.com/JuliaWeb/OpenSSL.jl
https://github.com/JuliaWeb/OpenSSL.jl
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/JuliaWeb/OpenSSL.jl
- Owner: JuliaWeb
- License: mit
- Created: 2022-09-21T22:32:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-30T19:53:46.000Z (2 months ago)
- Last Synced: 2026-04-01T04:48:55.921Z (2 months ago)
- Language: Julia
- Size: 267 KB
- Stars: 19
- Watchers: 5
- Forks: 13
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-julia-security - OpenSSL.jl - Julia wrapper for OpenSSL cryptographic and TLS functionality. (Network Security / TLS and SSL)
README
# OpenSSL.jl
[OpenSSL](https://www.openssl.org/) Julia bindings.
[](https://github.com/JuliaWeb/OpenSSL.jl/actions?query=workflow%3ACI+branch%3Amain)
[](https://codecov.io/gh/JuliaWeb/OpenSSL.jl)
## Installation
The package can be installed with Julia's package manager,
either by using the Pkg REPL mode (press `]` to enter):
```
pkg> add OpenSSL
```
or by using Pkg functions
```julia
julia> using Pkg; Pkg.add("OpenSSL")
```
## Project Status
The package has matured and is used in many production systems.
But as with all open-source software, please try it out and report your experience.
The package is tested against current Julia LTS (1.6), latest release (1.8), and nightly on Linux, macOS, and Windows.
## Contributing and Questions
Contributions are very welcome, as are feature requests and suggestions. Please open an
[issue][issues-url] if you encounter any problems or would just like to ask a question.
## Usage
While various parts of the openssl API are wrapped and tested, the main user-facing API expected to work
at the moment is for http TLS encryption/decryption, used like:
```julia
using OpenSSL, Sockets
# open a simple TCP connection to an https endpoint
tcp = connect("www.nghttp2.org", 443)
# wrap tcp socket in OpenSSL.SSLStream
ssl = SSLStream(tcp)
# inject host for cert verification
OpenSSL.hostname!(ssl, "www.nghttp2.org")
# perform TLS handshake
OpenSSL.connect(ssl)
# can now write/read from ssl
request_str = "GET / HTTP/1.1\r\nHost: www.nghttp2.org\r\nUser-Agent: curl\r\nAccept: */*\r\n\r\n"
written = write(ssl, request_str)
@test !eof(ssl)
io = IOBuffer()
sleep(2)
write(io, readavailable(ssl))
response = String(take!(io))
@test startswith(response, "HTTP/1.1 200 OK\r\n")
close(ssl)
```
[issues-url]: https://github.com/JuliaWeb/OpenSSL.jl/issues