1

I am trying to execute post request using rest-assured with multipart/form-data, the request contains with a url with parameters and file to be attached

Below is the code which I am trying and getting handshake error how can I attach a file with url ?

RequestSpecification httpRequest = RestAssured
                                    .given()
                                    .relaxedHTTPSValidation()
                                    .cookie("SESSION", cookieVal)
                                    .header("Content-Type", "multipart/form-data")
                                    .header("accept","application/json")
                                    .multiPart(new File("CorporateWallpaper.jpg")) ;

Response response = httpRequest.request().post(url);
System.out.print(response.getStatusCode());

Actual result

javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
    at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1321)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1160)
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)
Kimmo Lehto
  • 5,910
  • 1
  • 23
  • 32
testerBDD
  • 255
  • 3
  • 18
  • Checked [this](https://stackoverflow.com/questions/21245796/javax-net-ssl-sslhandshakeexception-remote-host-closed-connection-during-handsh) ? – Abhishek Jan 09 '19 at 08:48

1 Answers1

0

Not really sure about your environment. Found this link, can you check protocol versions once.

jwatts
  • 34
  • 4