I built it from source and added the static library to my project using a module map.
Post
Replies
Boosts
Views
Activity
MacOS 15.0
I've also tried the openldap config settings to disable cert validation and to provide a specific CA cert file. Neither seems to have any effect. The openldap library is statically linked into my app. Below is a code fragment of the init function.
public init(url:String = "ldaps://localhost", loginData: Login? = nil, codePage: Iconv.CodePage = .UTF8) throws {
if codePage != .UTF8 {
// we need a pair of code pages to transit in both directions.
iconv = try Iconv(from: codePage, to: .UTF8)
iconvR = try Iconv(from: .UTF8, to: codePage)
}//end if
ldap = OpaquePointer(bitPattern: 0)
//var certOption = LDAP_OPT_X_TLS_NEVER
// var certOption: Int32 = LDAP_OPT_X_TLS_NEVER
//
// var r = ldap_set_option(ldap, LDAP_OPT_X_TLS_REQUIRE_CERT,&certOption)
// guard r == LDAP_SUCCESS else {
// throw Exception.message("TLS NEVER: "+LDAP.error(r))
// }
var certFile: String = "/etc/lbCerts/igTreeCA.pem"
var r = ldap_set_option(ldap, LDAP_OPT_X_TLS_CACERTFILE, certFile)
guard r == LDAP_SUCCESS else {
throw Exception.message("TLS CERTFILE: "+LDAP.error(r))
}
r = ldap_initialize(&ldap, url)
I created a info.plist and added NSAllowsArbitraryLoads=true but that made no difference. Grabbed a trace with Wireshark and I see the TLS negotiation failing with an error 48, Unknown CA.
Can anyone provide any insight into why certificate trust evaluation succeeds with the cmd line app but fails from the SwiftUI app? The cow making the connection is identical!