Greg Martin wrote:
> On Fri, 2015-02-20 at 15:05 -0500, Ted Unangst wrote:
> > Greg Martin wrote:
> > >
> > > I'd have to say no. There are structures used but not documented and the
> > > one line description of some of the functions could be open to
> > > interpretation. Sample usage is never amiss in my estimation.
> >
> > I'd appreciate knowing what you found missing. I know it's pretty barren as
> > is, but whatever left you guessing would be a good place for me to start
> > filling it out.
>
> It's well written. Initially I thought that struct tls_config and struct
> tls should be documented but it seems the inner details aren't needed.
>
> It wasn't clear to me what the second struct in tls_accept_socket should
> be but from looking at the source of openbsd httpd it is obvious it is a
> client context to be used in read and writes.
>
Yes, that's a good example of something we should clarify.
> My compiler reports:
>
> tls_test.c:40:2: error: void value not ignored as it ought to be
> if (tls_config_set_protocols (cfg, protocols) < 0) {
>
> It is documented as returning int.
oops. Fixed.
>
> In order to build libtls in portable it was neccessary to configure with
> --enable-libtls which doesn't seem to be documented. I had to build a
> few times to get that one figured out.
>
> I wrote a small program yesterday using the SSL libraries (OpenSSL) to
> respond to an https request. This morning I converted it to libtls from
> libressl.
>
> This is the current output:
I think we're still a little shy telling people to depend on it yet, which is
why portable doesn't build by default.
The error below may be because you're missing -lssl and -lcrypto.
>
>
> greg@greg-softsprocket:~/Development/tests/c/ssl$ gcc -Wall -std=c11
> -D_POSIX_SOURCE tls_test.c -o tls_test -L/usr/local/lib -ltls
> greg@greg-softsprocket:~/Development/tests/c/ssl$ sudo ./tls_test
> ./tls_test: error while loading shared libraries: libtls.so.2: cannot open
> shared object file: No such file or directory
> greg@greg-softsprocket:~/Development/tests/c/ssl$ ls -l /usr/local/lib | grep
> tls
> -rw-r--r-- 1 root root 352342 Feb 21 09:49 libtls.a
> -rwxr-xr-x 1 root root 987 Feb 21 09:49 libtls.la
> lrwxrwxrwx 1 root root 15 Feb 21 09:49 libtls.so -> libtls.so.2.0.2
> lrwxrwxrwx 1 root root 15 Feb 21 09:49 libtls.so.2 -> libtls.so.2.0.2
> -rwxr-xr-x 1 root root 179047 Feb 21 09:49 libtls.so.2.0.2
>
>
>