Uses old Rust 2015
0.1.0 |
|
---|
#11 in #certificate-chain
36KB
663 lines
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
This is a demo program for libwebpki.
build.rs shows how to create a build script that embeds a set of trust anchors into a program in a compact form, given a set of X.509 root certificate files.
The function verify_cert
in
src/verify_tls_cert.rs demonstrates how to use the
libwebpki API to verify a certificate.
You can build this with cargo build
. Cargo will download libwebpki, ring,
and the other dependencies automatically as part of the build.
This program connects to the given server over TLS to extract its certificate chain. After building the program, you can run it as so:
$ target/debug/verify_tls_cert briansmith.org
OK
$ target/debug/verify_tls_cert expired.badssl.com
CertExpired
$ target/debug/verify_tls_cert wrong.host.badssl.com
CertNotValidForName
This demo does not implement the full TLS protocol--it implements just enough to extract the server's certificate chain.
License
See LICENSE. This project happily accepts pull requests without any formal copyright/contributor license agreement. Pull requests must explicitly indicate who owns the copyright to the code being contributed and that the code is being licensed under the same terms as the existing libwebpki code.
Bug Reporting
Please report bugs either as pull requests or as issues in the issue tracker.
Online Automated Testing
Travis CI is used for Linux and Mac OS X. Appveyor is used for Windows.
OS | Arch. | Compilers | Status |
---|---|---|---|
Linux | x86, x64 | GCC 4.8, 4.9, 5; Clang 3.4, 3.5, 3.6 | |
Mac OS X x64 | x86, x64 | Apple Clang 6.0 (based on Clang 3.5) | |
Windows | x86, x64 | MSVC 2013 (12.0), 2015 (14.0) |
Dependencies
~6–13MB
~245K SLoC