Secure Email Using STARTTLS
Secure Email Using STARTTLS
Postby raghunabu » Fri Apr 01, 2016 7:58 pm
Hi,
We are working on secure email feature ( Non-OS SDK v1.5.2 ) for ESP8266 using STARTTLS approach.
As step 1,
To check SSL connection , We tried HTTPS client without any certificates and it works.
Now we tried below scenario
1. Do non-secure tcp connect - Works
2. Send EHLO <mail server> - Works
3. Send STARTTLS - Works
4. -----Now do TLS Negotiation without closing connection - ???
5. Send EHLO
6. ......Other smtp email commands ...
After #3, i.e we receive " S: 220 Ready to start TLS " response
How to do a TLS negotiation using Non-OS SDK without closing the non-secure connection ?
Below is the requirement , what we want to achieve using Espressif Non-OS SDK,
- start by creating a normal TCP socket and connect it to smtp.gmail.com:587
- send a "ehlo [127.0.0.1]\r\n" command
- get the answers from the server (Notice: so far everything is in clear)
- send a "STARTTLS\r\n" command
- get the answer (i.e. "220 Ready for TLS")
- at this moment, create your ssl wrapper (method, ctx, etc...) and use "SSL_set_fd" and "SSL_connect" to activate it
- send a new "ehlo [127.0.0.1]\r\n" command but using the SSL socket
From now on, use "SSL_write" and "SSL_read" with the SSL socket to send your authentication information and email.
Please let us know if you have any pointers here...
We are working on secure email feature ( Non-OS SDK v1.5.2 ) for ESP8266 using STARTTLS approach.
As step 1,
To check SSL connection , We tried HTTPS client without any certificates and it works.
Now we tried below scenario
1. Do non-secure tcp connect - Works
2. Send EHLO <mail server> - Works
3. Send STARTTLS - Works
4. -----Now do TLS Negotiation without closing connection - ???
5. Send EHLO
6. ......Other smtp email commands ...
After #3, i.e we receive " S: 220 Ready to start TLS " response
How to do a TLS negotiation using Non-OS SDK without closing the non-secure connection ?
Below is the requirement , what we want to achieve using Espressif Non-OS SDK,
- start by creating a normal TCP socket and connect it to smtp.gmail.com:587
- send a "ehlo [127.0.0.1]\r\n" command
- get the answers from the server (Notice: so far everything is in clear)
- send a "STARTTLS\r\n" command
- get the answer (i.e. "220 Ready for TLS")
- at this moment, create your ssl wrapper (method, ctx, etc...) and use "SSL_set_fd" and "SSL_connect" to activate it
- send a new "ehlo [127.0.0.1]\r\n" command but using the SSL socket
From now on, use "SSL_write" and "SSL_read" with the SSL socket to send your authentication information and email.
Please let us know if you have any pointers here...
-
- Posts: 1
- Joined: Sat Oct 29, 2016 3:43 am
Re: Secure Email Using STARTTLS
Postby krhodes@netboxsc.com » Sat Oct 29, 2016 3:48 am
Hello,
I am also trying to use the NON_OS SDK (rev 2.0) and have the exact same requirement. I need to support StartTLS authentication, which requires not closing the socket between creating the insecure connection and then adding a secure envelope on it and sending and receiving with SSL.
You said the RTOS version was a possibility. How do you turn an existing insecure connection into a secure one?
Also, are there plans to add this functionality to the non-RTOS SDK? I'm worried that the size and performance overhead of the RTOS SDK will be too great for my needs. What is your experience in comparing an application written using each SDK?
Thanks...Keith
I am also trying to use the NON_OS SDK (rev 2.0) and have the exact same requirement. I need to support StartTLS authentication, which requires not closing the socket between creating the insecure connection and then adding a secure envelope on it and sending and receiving with SSL.
You said the RTOS version was a possibility. How do you turn an existing insecure connection into a secure one?
Also, are there plans to add this functionality to the non-RTOS SDK? I'm worried that the size and performance overhead of the RTOS SDK will be too great for my needs. What is your experience in comparing an application written using each SDK?
Thanks...Keith
-
- Posts: 2
- Joined: Mon Feb 26, 2018 8:48 pm
Re: Secure Email Using STARTTLS
Postby zafarpatel7 » Mon Mar 12, 2018 3:24 pm
i am also getting same problem
when i am send AUTH LOGIN the connection was closed
when i am send AUTH LOGIN the connection was closed
Who is online
Users browsing this forum: No registered users and 3 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.