<!--
{
  "availability" : [
    "iOS: 7.0.0 - 27.0.0",
    "iPadOS: 7.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.10.0 - 27.0.0",
    "tvOS: 10.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MultipeerConnectivity",
  "identifier" : "/documentation/MultipeerConnectivity/MCEncryptionPreference/optional",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Multipeer Connectivity"
    ],
    "preciseIdentifier" : "c:@E@MCEncryptionPreference@MCEncryptionOptional"
  },
  "title" : "MCEncryptionPreference.optional"
}
-->

# MCEncryptionPreference.optional

The session prefers to use encryption, but accepts unencrypted connections. A connection uses encryption when all the peers choose either [`MCEncryptionPreference.optional`](/documentation/MultipeerConnectivity/MCEncryptionPreference/optional) or [`MCEncryptionPreference.required`](/documentation/MultipeerConnectivity/MCEncryptionPreference/required). If some peers choose [`MCEncryptionPreference.none`](/documentation/MultipeerConnectivity/MCEncryptionPreference/none), then the session will not be encrypted. For this reason, if some peers running your app can be configured without encryption, you should always assume that the session is unencrypted.

```
case optional
```

---

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)