Giter Club home page Giter Club logo

gnutls.jl's Introduction

GnuTLS.jl

Add transport layer security (TLS) to any Julia Stream

Build Status Coverage Status

Installation: Pkg.add("GnuTLS")

API

GnuTLS.jl can add TLS support to any transport layer implementing the Julia IOinterface (e.g. IOStream, TcpSocket, NamedPipe, TTY, ...)

The following functions are currently provided:

  • GnuTLS.Session()

    Create a new SSL/TLS session. After initialization this object becomes a valid Julia IO object and may be used as such.

    NOTE: This method is not exported by default and should be used as GnuTLS.Session

  • GnuTLS.CertificateStore()

    Initialize an empty certificate store. Support for authentication is incomplete in the current version

    NOTE: This method is not exported by default and should be used as GnuTLS.CertificateStore

  • set_credentials!(s::Session,c::CertificateStore)

    Associates the CertificateStore c with the session s. The certificate from the server will be stored here and may later be validated before processing further requests.

  • set_priority_string!(s::Session,priority::ASCIIString="NORMAL")

    Set the GnuTLS priority string, used to determin which protocol versions to support. For a full list of supported options, see the GnuTLS manual

  • associate_stream{S<:IO,T<:IO}(s::Session, read::S, write::T=read)

    Set the transport layer for the current session.

  • handshake!(s::Session)

    Perform the SSL/TLS handshake. On success the Session becomes active and may be used like any other streaming IO object.

  • init()

    Initialize the GnuTLS library. This function is automatically called when the package is loaded and thus you should rarely have to call it yourself.

  • deinit()

    Undo init and free all associated resources.

Usage

The following code snippet demonstrates how the GnuTLS.jl package may be used to query an HTTPS resource:

	using GnuTLS
	sess = GnuTLS.Session()
	set_priority_string!(sess)
	set_credentials!(sess,GnuTLS.CertificateStore())
	associate_stream(sess,connect("github.com",443))
	handshake!(sess)
	write(sess,"GET / HTTP/1.1\r\n\r\n")
	print(readall(sess))

gnutls.jl's People

Contributors

amitmurthy avatar iainnz avatar ihnorton avatar keno avatar porterjamesj avatar quinnj avatar sbromberger avatar staticfloat avatar stevengj avatar swdunlop avatar

Watchers

 avatar  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.