Search code examples
apigee

How to configure SSLInfo programmatically?


I am working with Apigee Edge. I'm using named servers so that I can deploy to multiple environments without code changes while accessing different backends.

In a non-prod environment I need to connect to one backend and not use SSL - the server is not setup to accept SSL connections. In a prod environment I need to connect to a different backend and use SSL. In my TargetEndpoint I have the following HTTPTargetConnection:

<HTTPTargetConnection>
    <SSLInfo>
        <Enabled>false</Enabled>
    </SSLInfo>
    <LoadBalancer>
        <Server name="myServer"/>
    </LoadBalancer>
    <Path>/my_path</Path>
</HTTPTargetConnection>

Is it possible to change SSInfo/Enabled programmatically?


Solution

  • The load balanced server(target server) connection should handle this. In you non prod environment configure the server to use non-SSL and SSL in prod. The proxy is abstracted out from the server configuration - as long as the target server name remains same the proxy will work.

    Please look at the Target server API to change configuration.

    http://apigee.com/docs/api/api_resources/51-targetservers

    By the way target servers are specific to environments so it should work in you case.

    Here is JSON to add SSLInfo:

    {
        "host": "0.0.0.0",
        "isEnabled": true,
        "name": "my_Server",
        "port": 80,
        "sSLInfo": {
            "ciphers": [ ],
            "clientAuthEnabled": false,
            "enabled": false,
            "ignoreValidationErrors": false,
            "protocols": [ ]
        }
    }