<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/StreamSocketSecurityLevel",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@T@NSStreamSocketSecurityLevel"
  },
  "title" : "StreamSocketSecurityLevel"
}
-->

# StreamSocketSecurityLevel

`NSStream` defines these string constants for specifying the secure-socket layer (SSL) security level.

```
struct StreamSocketSecurityLevel
```

## Discussion

You access and set these values using the `NSStreamSocketSecurityLevelKey` property key.

## Topics

### Type Properties

[`negotiatedSSL`](/documentation/Foundation/StreamSocketSecurityLevel/negotiatedSSL)

Specifies that the highest level security protocol that can be negotiated be set as the security protocol for a socket stream.

[`none`](/documentation/Foundation/StreamSocketSecurityLevel/none)

Specifies that no security level be set for a socket stream.

[`ssLv2`](/documentation/Foundation/StreamSocketSecurityLevel/ssLv2)

Specifies that SSL version 2 be set as the security protocol for a socket stream.

[`ssLv3`](/documentation/Foundation/StreamSocketSecurityLevel/ssLv3)

Specifies that SSL version 3 be set as the security protocol for a socket stream.

[`tlSv1`](/documentation/Foundation/StreamSocketSecurityLevel/tlSv1)

Specifies that TLS version 1 be set as the security protocol for a socket stream.



---

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)