Giter Club home page Giter Club logo

evtssl's Introduction

how to

// create an object that creates/configures bufferevents
evt_ssl_t *factory = evt_ssl_create(evbase, "xkcd.com", 443, NULL, NULL);

// if you want to do anything special with SSL use evt_ssl_reconfigure

// evt_ssl_new_bev (fd = -1) returns an unconnected bufferevent that can
// be used with bufferevent_setfd, bufferevent_socket_connect,
// or evhttp_connection_base_bufferevent_new

// evt_ssl_listen and evt_ssl_connect are helpers for the creation of ready-to-use
// bufferevents.
// evt_ssl_listen uses an evconnlistener internally and binds to a single port.

// evt_ssl_connect starts a DNS lookup and returns the bufferevent immediately.
// the factory needs to stay alive until BEV_EVENT_CONNECTED event is triggered.
struct bufferevent *bev = evt_ssl_connect(factory);

// created bufferevents to need the factory anymore (except for those created
// using _connect that haven't had the BEV_EVENT_CONNECTED event be triggered)
evt_ssl_free(factory);

problem

evtssl offers factory that 'produces' bufferevents. The factory takes care of DNS and SSL and it's products don't depend on it's existence once a successful connection has been established.

The reasoning behind that is: Upon a connection loss, one will wan't to reset the transport layer. When using TLS, that's horribly complicated - even more when it's supposed to happen asynchronously.

Or: I didn't want to write this code twice. If you are dealing with SSL and libevent, feel free to use this library or steal some of the code ;-) If you see something that should or could be done better, feel free to file a complaint or open a pull-request.

evtssl's People

Contributors

yogo1212 avatar

Watchers

 avatar  avatar  avatar  avatar

evtssl's Issues

Create DUNS number for SSL EV

Please help me. How to register SSL EV? Because it requires a duns number. I do not own a company, so I also do not have a duns number for verification. Please help.

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.