swiftapp-transport-securitytransport-security

How do I make use of SSLSetALPNProtocols?


I'm working on a TLS library for the vapor project and am supporting both Apple's (Transport-)Security and OpenSSL for use in an HTTP/2 client and server.

On this line of code I'm trying to call SSLSetALPNProtocols. Regardless of my approach, I'm met with an ld linker error on that line of code.

Undefined symbols for architecture x86_64:
  "_SSLSetALPNProtocols", referenced from:
      __T08AppleSSL9SSLOptionV4alpnACSaySSG9protocols_tFZySo10SSLContextCKcfU_ in Options.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

There's no documentation available to highlight a possible obvious mistake since the page is empty.

So, how do I get this code to compile with ALPN support?


Solution

  • As of the latest macOS and Xcode beta with Swift 4.1 I've got this up and running.