1

I have this application and I have been asked to implement https, I have edited the XML file with the following lines:

<connector name="https" protocol="HTTP/1.1" scheme="https" 
           socket-binding="https" 
           enable-lookups="false" secure="true">
    <ssl name="kikou-ssl" key-alias="kikou" 
         password="kikou" 
         certificate-key-file="../standalone/configuration/kikou.keystore" 
         protocol="TLSv1" verify-client="false"/>
</connector>

So far every thing is fine; I have HTTPs working fine, BUT, what I have to do is to use the HTTPS only for couple of wabservices! so I don't really know how to do it.

I thought about two solutions but I don't know really how to try them:

  1. Edit the xml file with an attribut like : javaclass="search".
  2. Add something in the search class but here I don't know what to put, I have tried so far:

    if (httpServletRequest.getRequestURL().toString().contains("/user/account") && 
        servletRequest.getProtocol().contains("HTTP")) {
        throw new ResourceNotFoundException("The url should be HTTPS");
    }
    

But it didn't work.

Thank you for any comments or answers!

Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183
  • The context you have provided is minimal so I may be off-target but the answer here (http://stackoverflow.com/questions/4281587/ssl-for-specific-pages-url-patterns-in-tomcat) may help you out. The configuration involved would be in the web.xml file. – dcbyers Mar 24 '16 at 14:35
  • @dcbyers thank you for your comment, you mean that i should edit in my app the web.xml and not in the configuration file of my server standalone.xml ? – Mehaibia Oumaima Mar 24 '16 at 15:39
  • Possible duplicate of [How do I specify host and port when accessing a web service from JAX-WS-generated code?](http://stackoverflow.com/questions/649019/how-do-i-specify-host-and-port-when-accessing-a-web-service-from-jax-ws-generate) – Paul Sweatte Jun 22 '16 at 21:43

0 Answers0