Enable TLSv1.2 in JavaScript for target.url variable

Not applicable

Do we have any work around to set TLSv1.2 protocol in JavaScript.

Since i am calling a url using target.url in javascript at target endpint,

So my <HTTPTargetConnection> part get skipped every time when i call an url using target.url and i required to send the request with TLSv1.2 enable.

<HTTPTargetConnection>
    <URL>{Get skipped as i call target.url directly through JS}</URL>
    <SSLInfo>
    <Enabled>true</Enabled>
        <Protocols>
            <Protocol>TLSv1.2</Protocol>
        </Protocols>
    </SSLInfo>
</HTTPTargetConnection>
0 7 576
7 REPLIES 7

Hi, I'm not clear on your question, or the problem you are having.

You wrote

So my <HTTPTargetConnection> part get skipped every time when i call an url using target.url and i required to send the request with TLSv1.2 enable.

Can you state this in a different way? Or elaborate? How do you know "the HTTPTargetConnection part gets skipped" ? What specifically are you observing?

The Problem is whenever i am setting target.url using a policy the <HTTPTargetConnection> values at target endpoint is always overwrite by target.url

So my concern is how i can set Protocol TLSv1.2 in any policy like JS or Assignmessage. As i need to pass it with targeturl.

I am setting target.url directly using JS.

<HTTPTargetConnection>
<URL>{Get skipped as i call target.url directly through JS}</URL>
<SSLInfo>
<Enabled>true</Enabled>
<Protocols>
<Protocol>TLSv1.2</Protocol>
</Protocols>
</SSLInfo>
</HTTPTargetConnection>

Not applicable

@Umanng Goel : You can achieve it by following work around:

create a proxy(#1) wherein set Protocol in HTTPTargetConnection

<HTTPTargetConnection>
<URL>provide target url</URL>
<SSLInfo>
<Enabled>true</Enabled>
<Protocols>
<Protocol>TLSv1.2</Protocol>
</Protocols>
</SSLInfo> 
</HTTPTargetConnection>

Create another proxy(#2) and call the first proxy(#1) in it.

set the response from proxy(#1) and use in proxy(#2).

This is called proxy chaining.

go through the below URL to know about proxy chaining.

http://docs.apigee.com/api-services/content/connecting-proxies-other-proxies

@Sachhida Das

Thanks for your reply

The Problem is i am making a service call out from which i am getting an url as response which i need to call at my backend.

So the thing is each time the url which i get from service call out response get change so i am trying to set the targeturl based on my service call out response.

Also the url required to TLSv1.2 which i am not able to set through JS.

@Umanng Goel: in that case, use HTTPTargetConnection rather than JS.

save the URL from service call out response and set in the URL.

<URL>https://{servicecallout.response.url}</URL>

Overall, It would be like below:

<HTTPTargetConnection><URL>https://{servicecallout.response.url}</URL><SSLInfo><Enabled>true</Enabled><Protocols><Protocol>TLSv1.2</Protocol></Protocols></SSLInfo></HTTPTargetConnection>

@Sachhida Das

I have already tried the same process, look like there is limitation as the url is not setting up at target endpoint side.

Please refer my earlier post TLSv1.2

@Umanng Goel

you will not be able to see in the curl command of trace that url is setting up but actually it does.

There could be some other issue.

If possible, could you plz share your proxy.