Error with SSL while building
zololol opened this issue · comments
Hello im getting this error could you please help me?
I'm compiling on Ubuntu 16.04 LTS with Swift version 4.0.2 (swift-4.0.2-RELEASE) installed via
eval "$(curl -sL https://apt.vapor.sh)"
sudo apt-get install swift vapor
Compile Swift Module 'MongoSocket' (2 sources)
/home/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:32:49: error: use of undeclared type 'SSL'
private let sslClient: UnsafeMutablePointer<SSL>?
^~~
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:33:42: error: use of undeclared type 'SSL_METHOD'
private let sslMethod: UnsafePointer<SSL_METHOD>?
^~~~~~~~~~
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:34:50: error: use of undeclared type 'SSL_CTX'
private let sslContext: UnsafeMutablePointer<SSL_CTX>?
^~~~~~~
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:217:21: error: use of unresolved identifier 'SSL_library_init'
SSL_library_init()
^~~~~~~~~~~~~~~~
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:218:21: error: use of unresolved identifier 'SSL_load_error_strings'
SSL_load_error_strings()
^~~~~~~~~~~~~~~~~~~~~~
KittenCTLS.ERR_lib_error_string:1:13: note: did you mean 'ERR_lib_error_string'?
public func ERR_lib_error_string(_ e: UInt) -> UnsafePointer<Int8>!
^
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:219:21: warning: 'OPENSSL_config' is deprecated
OPENSSL_config(nil)
^
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:220:21: error: use of unresolved identifier 'OPENSSL_add_all_algorithms_conf'
OPENSSL_add_all_algorithms_conf()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:224:30: error: use of unresolved identifier 'SSLv23_client_method'
let method = SSLv23_client_method()
^~~~~~~~~~~~~~~~~~~~
KittenCTLS.DTLS_client_method:1:13: note: did you mean 'DTLS_client_method'?
public func DTLS_client_method() -> OpaquePointer!
^
KittenCTLS.DTLSv1_client_method:2:13: note: did you mean 'DTLSv1_client_method'?
public func DTLSv1_client_method() -> OpaquePointer!
^
KittenCTLS.TLS_client_method:1:13: note: did you mean 'TLS_client_method'?
public func TLS_client_method() -> OpaquePointer!
^
KittenCTLS.TLSv1_client_method:2:13: note: did you mean 'TLSv1_client_method'?
public func TLSv1_client_method() -> OpaquePointer!
^
/home/asd/.build/checkouts/MongoKitten.git--6117878459241174725/Sources/MongoSocket/Socket.swift:234:35: error: use of unresolved identifier 'SSL_CTRL_OPTIONS'
SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION, nil)
^~~~~~~~~~~~~~~~
KittenCTLS.SSL_CTRL_CHAIN:1:12: note: did you mean 'SSL_CTRL_CHAIN'?
public var SSL_CTRL_CHAIN: Int32 { get }
^
KittenCTLS.SSL_CTRL_SET_MTU:1:12: note: did you mean 'SSL_CTRL_SET_MTU'?
public var SSL_CTRL_SET_MTU: Int32 { get }
^
error: terminated(1): /usr/bin/swift-build-tool -f '/home/asd/.build/debug.yaml' main
Reinstall openssl solved problem with apt-get
For future people looking at this comment: You need to install both libssl-dev
and openssl
. openssl
is usually installed by default on ubuntu, though