ERROR - Unable to establish connection: java.net.SocketTimeoutException: connect timed out
search cancel

ERROR - Unable to establish connection: java.net.SocketTimeoutException: connect timed out

book

Article ID: 418434

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

  • Connecting to the External Content Library, where vCenter requires a Proxy
    ERROR - Unable to establish connection: java.net.SocketTimeoutException: connect timed out
  • vCenter does not have internet access. Everything goes out through a proxy.

Environment

9.0.1.0

Cause

Creating a proxy connection is accomplished through the API.

Resolution

  1. Create a proxy configuration
    This command creates a new proxy definition named "Corporate Proxy" without authentication on port 80.

    curl -k -X POST https://${vcf_automation_host}/cloudapi/1.0.0/proxyConfigurations \
    -H 'Content-type: application/json' -H 'Accept: application/json;version=41.0.0-alpha' \
    -H 'Authorization: Bearer ${auth_value}' \
    -d '{
      "name": "Corporate Proxy",
      "authType": "NO_AUTH",
      "password": "",
      "host": "proxy.example.com",
      "port": 80
    }'

  2. Retrieve the Proxy Configuration ID
    Need the id field from the response of this GET call to reference the proxy configuration when creating a proxy rule.

    curl -k https://${vcf_automation_host}/cloudapi/1.0.0/proxyConfigurations \
    -H 'Content-type: application/json' -H 'Accept: application/json;version=41.0.0-alpha' \
    -H 'Authorization: Bearer ${auth_value}'

  3. Create a Proxy Rule per Destination:
    This command creates a rule that directs traffic to a specific destination FQDN and port (typically 443) via the proxy configuration defined in step 1.

    curl-k-XPOSThttps://${vcf_automation_host}/cloudapi/1.0.0/proxyRules\
    -H 'Content-type: application/json' -H 'Accept:application/json;version=41.0.0-alpha' \
    -H'Authorization: Bearer ${auth_value}'\
    -d '{
    "name":"Corporate Proxy Rule",
    "destination":"https://${destination_fqdn}$:443",
    "proxy":{"id":"urn:vcloud:${proxy_configuration_id}$"},
    "priority":0
    }'