title: How do setup mod_http_upload in ejabberd
body: <p>In ejabberd 18.01-2, installed in lxc container Ubuntu 18.04 Bionic LTS using <code>apt</code>, I'm trying to setup <code>mod_http_upload</code>.</p>
  
  <p>In the section <code>listen</code>, I have</p>
  
  <pre><code>listen:
    -
      port: 5444
      module: ejabberd_http
      tls: true
      request_handlers:
        "/upload": mod_http_upload
  </code></pre>
  
  <p>In the configuration file, commented port was 5444, however, in the current documentation, it is 5443, so I am not sure which one is right.</p>
  
  <p>In the modules section, I have</p>
  
  <pre><code>modules:
    mod_http_upload:             
      host: "upload.ejabberd.forumanalogue.fr"
      max_size: infinity                                       
      thumbnail: true              
      put_url: "https://ejabberd.forumanalogue.fr:5444/upload"
      docroot: "/ejabberd/upload"
  </code></pre>
  
  <p>When I start the service, I can see an odd message in the logs</p>
  
  <pre><code>2019-11-11 21:02:35.287 [warning] &lt;0.367.0&gt;@ejabberd_pkix:handle_call:255 No certificate found matching 'upload.ejabberd.forumanalogue.fr': strictly configured clients or servers will reject connections with this host; obtain a certificate for this (sub)domain from any trusted CA such as Let's Encrypt (www.letsencrypt.org)
  </code></pre>
  
  <p>It is strange because I have a signed wildcard certificate.</p>
  
  <pre><code>certfiles:                                                               
    - "/etc/letsencrypt/live/forumanalogue.fr/*.pem"
  </code></pre>
  
  <p>I can see the service with my client (Gajim) but when I try to send a file to another local account, I receive an error <code>Access denied by service policy</code>, see the complete log:</p>
  
  <pre><code>&lt;iq xml:lang='en' to='foo@forumanalogue.fr/gajim.HCLJ4BZI' from='upload.ejabberd.forumanalogue.fr' type='error' id='1dd35274-90e9-4b3b-9608-0fab59afe34e'&gt;
  &lt;request xmlns='urn:xmpp:http:upload'&gt;
  &lt;filename&gt;a.out&lt;/filename&gt;
  &lt;size&gt;27232&lt;/size&gt;
  &lt;content-type&gt;application/octet-stream&lt;/content-type&gt;
  &lt;/request&gt;
  &lt;error code='403' type='auth'&gt;
  &lt;forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/&gt;
  &lt;text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'&gt;Access denied by service policy&lt;/text&gt;
  &lt;/error&gt;
  &lt;/iq&gt;
  </code></pre>
  
  <p>I had to enable debug logging in order to see something. It is quite verbose, but I think that the relevant part, which is non redundant with the client message, is</p>
  
  <pre><code>2019-11-11 20:53:08.329 [debug] &lt;0.501.0&gt;@mod_http_upload:process_slot_request:544 Denying HTTP upload slot request from foo@forumanalogue.fr/gajim.HCLJ4BZI
  </code></pre>
  
  <p>Thank you for your help.</p>