タイトル通り、
An SSL error has occurred and a secure connection to the server cannot be made.
のエラーに対応します。
上記エラーの原因はHTTPS接続がAppleのセキュリティ水準に達していないことにあります。
検索エンジンで検索するといくらでも回答が出てきますが、以外とハマる点についても言及しておきます。
解決できるエラー文言
An SSL error has occurred and a secure connection to the server cannot be made.
App Transport Security has blocked a cleartext HTTP connection since it is insecure. Use HTTPS instead or add Exception Domains to your app's Info.plist.
などなど
環境
- Xcode13
- iOS15
対応
通常の解法
- プロジェクトの管理画面を見る
- プロジェクトのTARGETSを選択
- 「Signing & Capabilities」を開く
- 左上の「+ Capability」をクリック
- 「App Transport Security Exception」を選択
- 「App Transport Security Exception」欄の+を押下し、セキュリティ除外したいドメインを設定。