I'm trying to use Javascript to call a service use it's reponse to do some logic, but when I'm trying to call the service, I'm always getting this response:
"400 The plain HTTP request was sent to HTTPS port"
headers = {Authorization : "Bearer " + access_token}; exchange = httpClient.send(new Request("https://serviceaddress", "GET", headers)); exchange.waitForComplete();
The service I'm trying to call, is a proxy in APIGEE. What should I do?
Solved! Go to Solution.
The "https://serviceaddress" = that's a REAL DNS name, right? TLS negotiation will work only if you use a real DNS name.
Also, have you configured the SSLInfo for your JS step?
It should look something like this:
<Javascript name='JS-doSomething' timeLimit='200' > <SSLInfo> <Enabled>true</Enabled> <ClientAuthEnabled>false</ClientAuthEnabled> <TrustStore>ref://truststoreref</TrustStore> </SSLInfo> <ResourceURL>jsc://doSomething.js</ResourceURL> </Javascript>
Or if you want 2-way TLS, like this:
<Javascript name='JS-doSomething' timeLimit='200' > <SSLInfo> <Enabled>true</Enabled> <ClientAuthEnabled>true</ClientAuthEnabled> <KeyStore>ref://myKeystore</KeyStore> <KeyAlias>myKey</KeyAlias> <TrustStore>ref://truststoreref</TrustStore> </SSLInfo> <ResourceURL>jsc://doSomething.js</ResourceURL> </Javascript>
The "https://serviceaddress" = that's a REAL DNS name, right? TLS negotiation will work only if you use a real DNS name.
Also, have you configured the SSLInfo for your JS step?
It should look something like this:
<Javascript name='JS-doSomething' timeLimit='200' > <SSLInfo> <Enabled>true</Enabled> <ClientAuthEnabled>false</ClientAuthEnabled> <TrustStore>ref://truststoreref</TrustStore> </SSLInfo> <ResourceURL>jsc://doSomething.js</ResourceURL> </Javascript>
Or if you want 2-way TLS, like this:
<Javascript name='JS-doSomething' timeLimit='200' > <SSLInfo> <Enabled>true</Enabled> <ClientAuthEnabled>true</ClientAuthEnabled> <KeyStore>ref://myKeystore</KeyStore> <KeyAlias>myKey</KeyAlias> <TrustStore>ref://truststoreref</TrustStore> </SSLInfo> <ResourceURL>jsc://doSomething.js</ResourceURL> </Javascript>
Hi,
I've changed the real address for this before posting for disclosure reasons, but in my environment I'm using an actual address.
I didn't had configured the SSLInfo. Problem solved! Thank you very much for your attention and support!
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |