# Xwiki on windows - configure HTTPS

**URL:** <https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639>\
**Category:** Help / Discuss\
**Created:** [March 18, 2019, 10:46am UTC](https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639 "2019-03-18T10:46:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeromewts](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@jeromewts](https://forum.xwiki.org/u/jeromewts)\
**Post date:** [March 18, 2019, 10:46am UTC](https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639/1 "2019-03-18T10:46:19Z")

</div>

Hi everyone,

I have an installation on windows 2012 server and I would like to configure HTTPS. Can I force request http to https?

In the documentation, I see only this concerning https :  
By default the protocol to use to generate external URLs (https, http) is extracted from request to XWiki so most of the time you don’t have anything to do if you properly configured your proxy but it’s possible to force a specific protocol using xwiki.url.protocol property in _xwiki.cfg_ .

My wiki responds only in http. When I try to visit [https://localhost](https://localhost), it doesn’t work…

---

<div class="post-metadata">

**Author:** ![jeromewts](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@jeromewts](https://forum.xwiki.org/u/jeromewts)\
**Post date:** [March 19, 2019, 9:54am UTC](https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639/2 "2019-03-19T09:54:32Z")

</div>

Nobody?

---

<div class="post-metadata">

**Author:** ![bstewart](https://forum.xwiki.org/user_avatar/forum.xwiki.org/bstewart/32/1585_2.png) [@bstewart](https://forum.xwiki.org/u/bstewart)\
**Post date:** [March 19, 2019, 9:36pm UTC](https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639/3 "2019-03-19T21:36:42Z")

</div>

Configure https in your servlet container (e.g., Tomcat).

How you do that depends on which servlet container you are using.

---

<div class="post-metadata">

**Author:** ![ClemensRobbenhaar](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clemensrobbenhaar/32/930_2.png) [@ClemensRobbenhaar](https://forum.xwiki.org/u/ClemensRobbenhaar)\
**Post date:** [March 19, 2019, 10:28pm UTC](https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639/4 "2019-03-19T22:28:19Z")

</div>

If you have XWiki running inside Tomcat then you need to add a SSL certificate and fiddle with the configuration in the conf\server.xml file. This is explained in the tomcat documentation, i.e. here:

[Apache Tomcat 8 (8.5.100) - SSL/TLS Configuration How-To](https://tomcat.apache.org/tomcat-8.5-doc/ssl-howto.html)

It might be easier to add a second server like Apache or Nginx to handle the https part (and also to redirect all http-requests to https). In case of Nginx this is documented here:

[https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#Hhttps28secure29](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#Hhttps28secure29)

(though the documentation is somewhat Unix-oriented). I have been able to get Apache set up with https under Windows successfully some time ago, but I need to dig out my notes about that.

In that case it might be easier to get a SSL certificate via “[LetsEncrypt](https://letsencrypt.org/)” as for these servers ready-to-use scripts exist to assist with fetching the certificate. However this only works if your server is connected to the internet and has a valid name. For installations on “localhost” you will need to use “Dummy”-certificates. (How to create such a SSL-Certificate via the commandline is explained in the above tomcat documentation.)

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [June 29, 2020, 3:57pm UTC](https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639/5 "2020-06-29T15:57:42Z")

</div>

If you’re using tomcat see [https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HConfiguringtomcatforhttps](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HConfiguringtomcatforhttps)

---

<div class="post-metadata">

**Author:** ![Kido](https://forum.xwiki.org/user_avatar/forum.xwiki.org/kido/32/807_2.png) [@Kido](https://forum.xwiki.org/u/Kido)\
**Post date:** [October 26, 2022, 3:42pm UTC](https://forum.xwiki.org/t/xwiki-on-windows-configure-https/4639/6 "2022-10-26T15:42:24Z")

</div>

> [@jeromewts](#):
>
> Can I force request http to https?

A bit late, but maybe for others: To really force HTTP to HTTPS you have to add the following lines to the web.xml of XWiki (worked for tomcat on Windows 10)

```auto
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Secured</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

```
