[GH-ISSUE #725] NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." when connecting to Twitter using OAuth 1.0 in Swift iOS #470

Open
opened 2026-03-03 16:48:54 +03:00 by kerem · 1 comment
Owner

Originally created by @yugbhavsar on GitHub (Nov 8, 2024).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/725

Since updating Xcode to version 16.0 on macOS 14.6.1, I am encountering an SSL error when attempting to authenticate with Twitter using OAuth 1.0 in my iOS app. This error did not occur in previous builds before the Xcode update, where the authentication process worked as expected.

The error message is as follows:

NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made."

Given the nature of this issue, I am unsure if it relates specifically to Xcode 16.0's new build configuration, SSL handling changes, or potentially an unnoticed change in macOS 14.6.1 that impacts secure network requests.

Environment:

  • Xcode Version: 16.0
  • macOS Version: 14.6.1
  • OAuth Version: 1.0

Below is the code snippet for reference:

let oauthswift = OAuth1Swift(
    consumerKey:    "******************",
    consumerSecret: "*****************",
    requestTokenUrl: "https://api.twitter.com/oauth/request_token",
    authorizeUrl:    "https://api.twitter.com/oauth/authorize",
    accessTokenUrl:  "https://api.twitter.com/oauth/access_token"
)

self.oauthswift = oauthswift
oauthswift.authorizeURLHandler = getURLHandler()
let _ = oauthswift.authorize(withCallbackURL: URL(string: "********************")!) { result in

        switch result {
        case .success(let (credential, _, _)):
            // my success code
        case .failure(let error):
            print(error.description)
        }
}

I have verified that:

  • consumerKey, consumerSecret, requestTokenUrl, authorizeUrl, and accessTokenUrl are up-to-date and match Twitter's current API specifications.
  • The callback URL is correctly set to the value assigned in the Twitter Developer account.
Originally created by @yugbhavsar on GitHub (Nov 8, 2024). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/725 Since updating Xcode to version 16.0 on macOS 14.6.1, I am encountering an SSL error when attempting to authenticate with Twitter using OAuth 1.0 in my iOS app. This error did not occur in previous builds before the Xcode update, where the authentication process worked as expected. The error message is as follows: NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." Given the nature of this issue, I am unsure if it relates specifically to Xcode 16.0's new build configuration, SSL handling changes, or potentially an unnoticed change in macOS 14.6.1 that impacts secure network requests. Environment: - Xcode Version: 16.0 - macOS Version: 14.6.1 - OAuth Version: 1.0 Below is the code snippet for reference: ``` let oauthswift = OAuth1Swift( consumerKey: "******************", consumerSecret: "*****************", requestTokenUrl: "https://api.twitter.com/oauth/request_token", authorizeUrl: "https://api.twitter.com/oauth/authorize", accessTokenUrl: "https://api.twitter.com/oauth/access_token" ) self.oauthswift = oauthswift oauthswift.authorizeURLHandler = getURLHandler() let _ = oauthswift.authorize(withCallbackURL: URL(string: "********************")!) { result in switch result { case .success(let (credential, _, _)): // my success code case .failure(let error): print(error.description) } } ``` I have verified that: - consumerKey, consumerSecret, requestTokenUrl, authorizeUrl, and accessTokenUrl are up-to-date and match Twitter's current API specifications. - The callback URL is correctly set to the value assigned in the Twitter Developer account.
Author
Owner

@phimage commented on GitHub (Nov 8, 2024):

I am not aware of any change except maybe the PrivacyInfo.xcprivacy that must be added
for downloading file for instance

<key>NSPrivacyAccessedAPITypes</key>
    <array>
        <dict>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>E174.1</string>
            </array>
        </dict>
    </array>

then for twitter, maybe try with x.com

<!-- gh-comment-id:2465246929 --> @phimage commented on GitHub (Nov 8, 2024): I am not aware of any change except maybe the PrivacyInfo.xcprivacy that must be added for downloading file for instance ```xml <key>NSPrivacyAccessedAPITypes</key> <array> <dict> <key>NSPrivacyAccessedAPIType</key> <string>NSPrivacyAccessedAPICategoryDiskSpace</string> <key>NSPrivacyAccessedAPITypeReasons</key> <array> <string>E174.1</string> </array> </dict> </array> ``` then for twitter, maybe try with x.com
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#470
No description provided.