Thanks! You’re using the OpenSSL 1.1 headers where all types are made opaque (forward declared C struct pointers). Swift imports opaque C types as OpaquePointer
and not UnsafePointer<struct>
. This unfortunately means that whilst in C you can write programs that work fine against OpenSSL 1.0 & 1.1, in Swift this is very hard (because OpenSSL 1.0’s types import as UnsafePointer<struct>
and 1.1’s types as OpaquePointer
).
You have basically 2 options:
- install the OpenSSL 1.0 headers
- use the OpenSSL 1.1 API which in Swift means
OpaquePointer
everywhere (for more information on that topic check this Opaque Pointers in Swift )
If you want a quick win, you might want to switch to Ubuntu 16.04 which defaults to OpenSSL 1.0 everywhere. Sad but easy