Python Connector for ASE

Connect to ASE from Python using HTTP tunneling

Connecting to ASE using HTTP tunneling

You can use HTTP(s) tunneling when the client needs access to a website database from a remote machine, but direct access to the database server on the specified port is forbidden. In conditions of restricted connectivity, when the database server is hidden behind a firewall or you need to transmit private network data through a public network, you can set up an HTTP tunnel to create a direct network link between the two locations.

If the firewall allows HTTP(S) connections, you can use the connector with a properly configured web server to connect to the database server. The connector comes with a PHP script that enables access to the database server through an HTTP tunnel. The tunnel.php script file is located in the \site-packages\devart\ase\http\ directory. You need to deploy it on a web server which will act as an HTTP tunneling server. The script must be accessible through HTTP—you can verify its accessibility in any web browser. The web server must support PHP 5 or later.

You can also use the Secure Shell forwarding, or SSH to tunnel network traffic. However, SSH is designed to encrypt traffic rather than traverse firewalls. Note that traffic tunneling or encryption increases the CPU and bandwidth usage. It is recommended that you use direct connection whenever possible.

Enable HTTP tunneling

  1. Import the module.
    import devart.ase
  2. Connect to a database using the connect() module method and obtain a connection object.
    
        my_connection = devart.ase.connect(
        Server="your_server",
    Database="your_database",
    UserId="your_username",
    Password="your_password", UseHttp="True",
    HttpUrl="https://hostname/tunnel.php",
    HttpTrustServerCertificate="True" )

HTTP tunneling parameters

The following table describes the HTTP tunneling parameters.

Parameter Description

UseHttp

Enables HTTP tunneling.

HttpUrl

The URL of the PHP script for HTTP tunneling

HttpUserName

The username for the password-protected directory that contains the HTTP tunneling script

HttpPassword

The password for the password-protected directory that contains the HTTP tunneling script

HttpTrustServerCertificate

Specifies whether to verify the server certificate chain during a TLS handshake. By default, the connector verifies the entire certificate chain.

The possible values are True and False. If the parameter is set to True, the connector will bypass walking the certificate chain to validate trust.

HTTP proxy parameters

If the HTTP tunneling server isn't directly accessible from the client machine, you can connect through a proxy server.

The following table describes the HTTP proxy parameters.

Parameter Description

ProxyHostName

The hostname or IP address of the proxy server

ProxyPort

The proxy port

ProxyUserName

The username for proxy authentication

ProxyPassword

The password for proxy authentication

© 2022-2025 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback