[NTLK] CyaSSL Library is a possibility

Jake Bordens jake at allaboutjake.com
Fri Feb 6 16:55:55 EST 2015


Hi Everyone.

I got a little side tracked and started playing with the CyaSSL library.  
I expected find all sorts of incompatibility and quickly move on to 
something else.  To my surprise, it compiles nicely using the Newton C++ 
tools... but compiling is a long way from being usable to initiate an SSL 
session or HTTPS request.

There are a few bits that need to be modified, but you can pretty much get 
the library to compile and link with little fuss.  You have to modify the 
code to remove static globals, as they are not allowed for NTK C++ 
modules.  You can simulate static global data by interacting with the 
NewtonScript side.  I wrote a little function stub that allocates some 
memory and stores it in "GetGlobals().CyaSSLGlobals".  Some ugly 
preprocessor macros from there, and no more static global.

I'm a bit out of practice with NewtonScript, especially when it comes to 
NIE Endpoints.  As far as I know there isn't any way to directly access an 
internet endpoint from the C++ side, so we'd need to work out how to to 
pass data back and forth.  (This would involve some glue code in both C++ 
and NewtonScript)  I can't envision a clean way to do this, so I've kind 
of hit a wall.  I mention this here in case someone has interest and 
knowledge to take this further.

http://retronewton.blogspot.com/2015/02/ssl-exercise-for-reader.html

Jake





More information about the NewtonTalk mailing list