4

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?

JoannisO
  • 875
  • 7
  • 13

2 Answers2

2

Currently that's impossible. Apple forgot to export the SSLSetALPNProtocols and SSLCopyALPNProtocols function.

I already filed rdar://34790589 (duplicate of rdar://33907676)

ePirat
  • 1,068
  • 11
  • 20
-1

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

JoannisO
  • 875
  • 7
  • 13
  • This is not an answer to your question, you should not accept it. – Ad N Aug 01 '19 at 08:51
  • There was a radar open that apple fixed and I posted an answer myself to indicate this. Would you rather see me keep this issue open indefinitely even though it should be resolved by apple now? – JoannisO Aug 02 '19 at 09:42