Coder Social home page Coder Social logo

erl_crl_example's Introduction

Simple CRL validation test for Erlang.

Currently Erlang has undocumented support for checking Certificate Revocation Lists (CRLs) when validating peer certificates. Due to the almost total lack of documentation, however, this can be challenging to implement.

Here is a sample SSL client/server with a client that supports checking the CRL of the server's certificate. It uses a modified make_cert.erl from OTP's SSL tests to generate 2 CAs and a bunch of certificates (and CRLs) and revokes one of them.

The client then connects 3 times, to 3 different ports, 5555, 5556 and 5557. Those ports are, respectively, a certificate signed by the root CA, a certificate signed by an intermediate CA and a revoked certificate signed by an intermediate CA. Thus the expected behaviour is for the first two connections to succeed and the third to fail.

To run the tests, simply run 'make check'.

Currently the latest release of Erlang, R16B02, has a bug in pubkey_crl.erl which makes this test fail if you don't use a patched beam. You only have to change one line, line 42:

AltNames = subject_alt_names(TBSCert#'OTPTBSCertificate'.extensions),

Needs to be changed to:

AltNames = (pubkey_cert:select_extension(?'id-ce-subjectAltName',
 TBSCert#'OTPTBSCertificate'.extensions))#'Extension'.extnValue,

Just drop the patched .beam into the ebin directory, and the test should start passing.

erl_crl_example's People

Contributors

vagabond avatar

Watchers

James Cloos avatar UM404 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.