CRM On Demand - Web Services Integration (MOSC)

MOSC Banner

Handshake Failure Error

Hi,

I am trying to execute the following but getting errors.

CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Api" AS

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

import java.io.OutputStreamWriter;

import java.net.HttpURLConnection;

import java.net.URL;


public class Api {


  public static void main(String[] args) {

    try {

      System.out.println(getCurl());

    } catch (IOException e) {

      e.printStackTrace();

    }

  }


  public static String getCurl() throws IOException {

    String curlResponse = "";

    System.setProperty("https.protocols", "TLSv1.2");

        String url = "my url";

    String csr = "value";

    URL obj = new URL(url);

    HttpURLConnection conn = (HttpURLConnection) obj.openConnection();

    conn.setRequestMethod("POST");

    conn.setRequestProperty("Accept", "application/json");

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center