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)