Make OpenVPN more secure & Prevent "TLS handshaking timeout"

alireza2n
Posts: 10
Joined: Thu Sep 23, 2010 2:59 pm

Make OpenVPN more secure & Prevent "TLS handshaking timeout"

Postby alireza2n » Sun Oct 17, 2010 10:05 am

Hi!
First of all, Amahi was my first step into linux servers & networking which played out great! Thanks to all developers & contributors! :)

I just found a way to check verify integrity of SSL/TLS handshakes, this will add "HMAC signature" to packets so Any UDP packet not bearing the correct HMAC signature can be dropped.

I believe this will solve "SSL/TLS handshake timeout" problems.

I live in a place where some firewall is somehow corrupting these packets, regardless of their protocol (TCP/UDP) or port (I even tried port 80!), now after adding "HMAC signature" everything goes smoothly as expected and OpenVPN works flawlessly, plus it is even more secure.

Here is how:

-On server :
open "Terminal" or use ssh to login into server as root, enter these:

Code: Select all

cd / cd /etc/openvpn/amahi openvpn -–genkey -–secret ta.key
If using Terminal:

Code: Select all

gedit /etc/openvpn/amahi.conf
If using SSH:

Code: Select all

nano /etc/openvpn/amahi.conf
Now add these lines to the end of file:

Code: Select all

tls-auth /etc/openvpn/amahi/ta.key 0 cipher AES-256-CBC
Save the config file:
If using Terminal : Save the file
If using SSH: press Ctrl+x , then y ,then press Enter

Let's restart openvpn service:

Code: Select all

service openvpn restart
you'll get something like this after this command :

Code: Select all

Shutting down openvpn [OK] starting openvpn [OK]
OK, there is one more thing left on server, you need to copy "ta.key" to a shared folder, because you have to use it on VPN client. a simple way to do this is to enter this, it will copy "ta.key" to "Docs" share folder which is accessible via Windows Share:

Code: Select all

cp /etc/openvpn/amahi/ta.key /var/hda/files/docs
- On Client:
Open HomeHDA.ovpn via a text editor (i.e Notepad), add these lines to end of it:

Code: Select all

tls-auth ta.key 1 cipher AES-256-CBC
Then save it, now we need to copy "ta.key" to the folder where the "HomeHDA.ovpn" exists.
On windows it should be copied to "C:\Program files\HDAConnect\config" or "C:\Program Files (x86)\HDAConnect\config".

Everything is set, fire up HDAConnect (if on windows) and use your username/password to connect. (as you know you cannot make a vpn tunnel from yourself to yourself! so you have to test it from another network ;) )

PS: Great thanks to writer of this article for giving me the clue :
http://www.techbabu.com/2009/12/openvpn ... -on-linux/

Please tell me if there are any mistakes in my commands, I'm not perfect. ;)

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Make OpenVPN more secure & Prevent "TLS handshaking time

Postby bigfoot65 » Wed Oct 20, 2010 4:50 am

Great work. Can you please add a wiki page at http://wiki.amahi.org for this guidance. You can login and create a page using your amahi.org credentials.

That will provide a better place for users versus it getting buried in the forums.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

alireza2n
Posts: 10
Joined: Thu Sep 23, 2010 2:59 pm

Re: Make OpenVPN more secure & Prevent "TLS handshaking time

Postby alireza2n » Wed Oct 20, 2010 8:27 am

Great work. Can you please add a wiki page at http://wiki.amahi.org for this guidance. You can login and create a page using your amahi.org credentials.

That will provide a better place for users versus it getting buried in the forums.
Sure! ;)
By the way, I think adding this to next release will improve Amahi OpenVPN.
------
Edit:
Should I edit the "VPN Troubleshooting" page or just add a new page with this thread's title? :?: (sorry I'm new to wiki editing)

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Make OpenVPN more secure & Prevent "TLS handshaking time

Postby bigfoot65 » Wed Oct 20, 2010 12:45 pm

Please add a new page. You can add a link to it on the VPN Troubleshooting page. In order to identify this for a future release, please file a bug at http://bugs.amahi.org.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Make OpenVPN more secure & Prevent "TLS handshaking time

Postby cpg » Wed Oct 20, 2010 1:36 pm

Great job indeed! Yeah, this is a good one for the wiki, very actionable!
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

alireza2n
Posts: 10
Joined: Thu Sep 23, 2010 2:59 pm

Re: Make OpenVPN more secure & Prevent "TLS handshaking time

Postby alireza2n » Thu Oct 21, 2010 11:44 am

I'm so sorry guys but I could not find any Add or Create a page in wiki, I only found Edit page...(account restriction maybe?). :?
PS: I also could not a feature request in bug tracker, can you tell me where is it?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Make OpenVPN more secure & Prevent "TLS handshaking time

Postby bigfoot65 » Thu Oct 21, 2010 12:05 pm

Hello,

In the wiki, once you log in...just add the page name after http://wiki.amahi.org/index.php/ and it will say not found....create new page.

As for the feature request, just enter it as a bug and we can change it to a feature request.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

alireza2n
Posts: 10
Joined: Thu Sep 23, 2010 2:59 pm

Re: Make OpenVPN more secure & Prevent "TLS handshaking time

Postby alireza2n » Thu Oct 21, 2010 1:26 pm

Hello,

In the wiki, once you log in...just add the page name after http://wiki.amahi.org/index.php/ and it will say not found....create new page.

As for the feature request, just enter it as a bug and we can change it to a feature request.
Thanks a lot for the help, both are done.
I also added edited Vpn Troubleshooting & VPN pages.

Who is online

Users browsing this forum: No registered users and 25 guests