---
title: startSecureConnection()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/urlsessionstreamtask/startsecureconnection()
---

# startSecureConnection()

Completes any enqueued reads and writes, and establishes a secure connection.

## Declaration

```swift
func startSecureConnection()
```

## Discussion

Discussion Authentication callbacks are sent to the session’s delegate using the urlSession(_:task:didReceive:completionHandler:) method.

## See Also

### Starting and stopping secure connections

- [stopSecureConnection()](foundation/urlsessionstreamtask/stopsecureconnection().md)
