<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/errSSLHostNameMismatch",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@Ea@errSSLProtocol@errSSLHostNameMismatch"
  },
  "title" : "errSSLHostNameMismatch"
}
-->

# errSSLHostNameMismatch

The host name you connected with does not match any of the host names allowed by the certificate.

```
var errSSLHostNameMismatch: OSStatus { get }
```

## Discussion

This is commonly caused by an incorrect value for the <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamSSLPeerName> property within the dictionary associated with the stream’s <doc://com.apple.documentation/documentation/CFNetwork/kCFStreamPropertySSLSettings> key.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)