• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

OpenVPN P2P client conf tls-client directive code

Scheduled Pinned Locked Moved OpenVPN
1 Posts 1 Posters 755 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P
    phil.davis
    last edited by Feb 27, 2015, 12:00 PM

    /etc/inc/openvpn.inc function openvpn_reconfigure()
    down in the client part:

    	// client specific settings
    
    	if ($mode == 'client') {
    
    		// configure p2p mode
    		switch($settings['mode']) {
    			case 'p2p_tls':
    				$conf .= "tls-client\n";
    			case 'shared_key':
    				$conf .= "client\n";
    				break;
    		}
    
    

    The OpenVPN doc http://openvpn.net/index.php/open-source/documentation/manuals/65-openvpn-20x-manpage.html says:

    –client
        A helper directive designed to simplify the configuration of OpenVPN's client mode. This directive is equivalent to:

    pull
            tls-client

    So why is "case 'p2p_tls'" got no break statement and thus falling through to also put the "client" directive in the conf file?

    That will be making it also effectively do "pull".

    I think this is why the Remote Network/s box on a P2P client has no effect - it gets the remote network routes pulled from what is in Local Network/s at the server end. Probably that is good - it is somewhat easier for the person configuring the server end to input the settings of what networks are reachable at the server end.

    The code just seems a little odd/accidental. This line could be removed without breaking anything:

    				$conf .= "tls-client\n";
    

    As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
    If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

    1 Reply Last reply Reply Quote 0
    1 out of 1
    • First post
      1/1
      Last post
    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
      This community forum collects and processes your personal information.
      consent.not_received