Axis2 embeded https server

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Axis2 embeded https server

Sterpu Victor
Hello
 
I'm trying to make a 2 way authentication https server with axis2 and I don't know how to activate https from code.
Server starts from code on http and works fine.
This is my code:
 
    public static void test() {
        try {
            ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
 
            SimpleHTTPServer server = new SimpleHTTPServer(configContext, 8080);
            server.start();
 
            File serviceArchiveFile = new File("C:\\Users\\victor\\Documents\\NetBeansProjects\\sr010\\jar\\axis2-1.7.3\\repository\\services\\StockQuoteService.aar");
            AxisServiceGroup serviceGroup = DeploymentEngine.loadServiceGroup(serviceArchiveFile, configContext);
 
            AxisConfiguration axiConfiguration = configContext.getAxisConfiguration();
            axiConfiguration.addServiceGroup(serviceGroup);
        } catch(Exception ex) {
            Logger.getLogger(Axis2ServerTest.class.getName()).log(Level.SEVERE, null, ex);
        }       
    }
 
I read the documentation here:

"Please note that by default HTTPS works only when the server does not expect to authenticate the clients (1-way SSL only) and where the server has the clients' public keys in its trust store. If you want to perform SSL client authentication (2-way SSL), you may use the Protocol.registerProtocol feature of HttpClient. You can overwrite the "https" protocol, or use a different protocol for your SSL client authentication communications if you don't want to mess with regular https. Find more information at http://jakarta.apache.org/commons/httpclient/sslguide.html"


 

But I don't know how how to set 1 way HTTPS yet.
 
Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Axis2 embeded https server

Andreas Veithen-2
SimpleHTTPServer doesn't support SSL. To get HTTPS support on the
server side, you need to deploy AxisServlet into a servlet container.

Andreas

On Mon, Jun 27, 2016 at 10:09 AM, Sterpu Victor <[hidden email]> wrote:

> Hello
>
> I'm trying to make a 2 way authentication https server with axis2 and I
> don't know how to activate https from code.
> Server starts from code on http and works fine.
> This is my code:
>
>     public static void test() {
>         try {
>             ConfigurationContext configContext =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
> null);
>
>             SimpleHTTPServer server = new SimpleHTTPServer(configContext,
> 8080);
>             server.start();
>
>             File serviceArchiveFile = new
> File("C:\\Users\\victor\\Documents\\NetBeansProjects\\sr010\\jar\\axis2-1.7.3\\repository\\services\\StockQuoteService.aar");
>             AxisServiceGroup serviceGroup =
> DeploymentEngine.loadServiceGroup(serviceArchiveFile, configContext);
>
>             AxisConfiguration axiConfiguration =
> configContext.getAxisConfiguration();
>             axiConfiguration.addServiceGroup(serviceGroup);
>         } catch(Exception ex) {
>
> Logger.getLogger(Axis2ServerTest.class.getName()).log(Level.SEVERE, null,
> ex);
>         }
>     }
>
> I read the documentation here:
>
> "Please note that by default HTTPS works only when the server does not
> expect to authenticate the clients (1-way SSL only) and where the server has
> the clients' public keys in its trust store. If you want to perform SSL
> client authentication (2-way SSL), you may use the Protocol.registerProtocol
> feature of HttpClient. You can overwrite the "https" protocol, or use a
> different protocol for your SSL client authentication communications if you
> don't want to mess with regular https. Find more information at
> http://jakarta.apache.org/commons/httpclient/sslguide.html"
>
>
>
>
> But I don't know how how to set 1 way HTTPS yet.
>
> Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]