---
title: stopSecureConnection()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/urlsessionstreamtask/stopsecureconnection()
---

# stopSecureConnection()

Completes any enqueued reads and writes, and closes the secure connection.

## Declaration

```swift
func stopSecureConnection()
```

## See Also

### Starting and stopping secure connections

- [startSecureConnection()](foundation/urlsessionstreamtask/startsecureconnection().md)
