Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added client-tls-smtp-overssl.c and client-tls-smtp-starttls.c #362

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
53 changes: 53 additions & 0 deletions tls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,59 @@ Sent (0): Testing 1, 2 and 3
Read (0): Testing 1, 2 and 3
```

## SMTP client Examples using TLS
Two types of SMTP client using TLS are available, both SMTP over SSL and STARTTLS.

See `client-tls-smtp-overssl.c` and `client-tls-smtp-starttls.c`.

Here are usage:

```
% ./client-tls-smtp-overssl <SERVER_NAME> <CERT_FILE>

% ./client-tls-smtp-starttls <SERVER_NAME> <CERT_FILE>
```

Example Output:
```
% ./client-tls-smtp-overssl smtp.gmail.com roots.pem
220 smtp.gmail.com ESMTP XXX-XXXX.....XX.XXX - gsmtp

250-smtp.gmail.com at your service, [...]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8

334 .....

Mail Address

```
```
% ./client-tls-smtp-starttls smtp.gmail.com roots.pem
220 smtp.gmail.com ESMTP XXX-XXX.....XX.XXX - gsmtp

250-smtp.gmail.com at your service, [...]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8

220 2.0.0 Ready to start TLS

334 .....

Mail Address:

```


## TLS Example with PK Callbacks and optionally Async

Expand Down
Loading