# %close_ssl() function

The %close_ssl function closes the socket
specified by the *fd* file descriptor, as well as
the secure connection specified by the *ssl_fd* descriptor.
The *fd* file descriptor is returned by a previous
call to %socket whereas the *ssl_fd* descriptor is returned buy a previous call to %accept_ssl() or %connect_ssl.

Note: To use this function, the OpenSSL libraries must be
installed.

## Syntax

```
var = %close_ssl(fd, ssl_fd)
```

## Parameter(s)

| fd | File descriptor of the local socket returned by a previous call to the FlashBASIC C function %socket(). |
| --- | --- |
| ssl_fd | File descriptor of the Secure connection. |

## Example(s)

```
if %close_ssl(fd, ssl_fd) then
 crt “close error”
stop
```
Note the use of the implicit (void) casting by not including
the statement as part of an assignment. The return code of the close
is thrown away.

## See also

- [%close() function](https://d3codex.com/pickbasic-flashbasic/percent-close-function/)
- [%accept_ssl() function](https://d3codex.com/pickbasic-flashbasic/percent-accept-ssl-function/)
- [%connect_ssl() function](https://d3codex.com/pickbasic-flashbasic/percent-connect-ssl-function/)
- [%read_ssl() function](https://d3codex.com/pickbasic-flashbasic/percent-read-ssl-function/)
- [%write_ssl() function](https://d3codex.com/pickbasic-flashbasic/percent-write-ssl-function/)

---
Source: https://d3codex.com/pickbasic-flashbasic/percent-close-ssl-function/ - part of the D3Codex reference.
