restlet-2.3.1

Upload a file using Restlet multipart/form-data in java

ぃ、小莉子 提交于 2020-01-02 09:58:50
问题 So I searched quite a bit now for sample codes but the only thing I found was on examples for the server side, meaning the receiving part . I want to create an application, that uses restlet to upload a file, content type: multipart/form-data . So I need the sending part How do I create the form for this? What I tried is the following, but it's not working: public void UploadFile(File f){ Form fileForm = new Form(); fileForm.add(Disposition.NAME_FILENAME, "test.jpg"); Disposition disposition

Restlet javax.net.ssl.SSLHandshakeException: null cert chain

谁说胖子不能爱 提交于 2019-12-03 09:28:32
问题 I am testing SSL communication between client and server locally. So I generated certificate using OpenSSL commands. Added this certificate in cacert file. Also generated .p12 file. I am using the same .p12 file in server and client. This is the server code Server server = component.getServers().add(Protocol.HTTPS, port); Series<Parameter> params = server.getContext().getParameters(); params.add("keystorePath", ".p12 file path"); params.add("keystoreType", "PKCS12"); params.add(

Restlet javax.net.ssl.SSLHandshakeException: null cert chain

柔情痞子 提交于 2019-12-03 00:01:52
I am testing SSL communication between client and server locally. So I generated certificate using OpenSSL commands. Added this certificate in cacert file. Also generated .p12 file. I am using the same .p12 file in server and client. This is the server code Server server = component.getServers().add(Protocol.HTTPS, port); Series<Parameter> params = server.getContext().getParameters(); params.add("keystorePath", ".p12 file path"); params.add("keystoreType", "PKCS12"); params.add("needClientAuthentication","true"); component.getDefaultHost().attach("", "/AA"), new AAClass()); component.start();