# Problems configuring SSL with snaps (caddy fails with result 'start-limit-hit')

**URL:** <https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670>\
**Category:** Community Support\
**Created:** [April 23, 2019, 1:28pm UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670 "2019-04-23T13:28:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![max](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@max](https://forums.rocket.chat/u/max)\
**Post date:** [April 23, 2019, 1:28pm UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/1 "2019-04-23T13:28:39Z")

</div>

Hi there. I’ve installed Rocket.Chat server, working mostly fine. The major trouble encountered is that files cannot be uploaded (stuck at 0%). Diggin’ and googlin’, I’ve found that this might be due to SSL errors. Indeed, if we put `tls self_signed` into the Caddyfile and restart the Caddy, file uploading works.

But our server is visible both from within the local network and from the Internet, and we intend to use RC clients from both sides. So, I believe, we need Let’s Encrypt working. Following the AutoSSL documentation, we get the caddy service running… only to learn that a minute later it fails with result `'start-limit-hit'`. Here are some of the last lines from `journalctl -u snap.rocketchat-server.rocketchat-caddy` (I’ve replaced my domain and server names):

> Apr 23 18:50:21 my.server.lan rocketchat-server.rocketchat-caddy[61857]: Activating privacy features… 2019/04/23 18:50:21 [[my.domain.me](http://my.domain.me)] failed to get certificate: [[my.domain.me](http://my.domain.me)] error presenting token: presenting with standard HTTP provider server: Could not start HTTP server for challenge → listen tcp :80: listen: address already in use  
> Apr 23 18:50:21 my.server.lan systemd[1]: snap.rocketchat-server.rocketchat-caddy.service: Main process exited, code=exited, status=1/FAILURE  
> Apr 23 18:50:21 my.server.lan systemd[1]: snap.rocketchat-server.rocketchat-caddy.service: Unit entered failed state.  
> Apr 23 18:50:21 my.server.lan systemd[1]: snap.rocketchat-server.rocketchat-caddy.service: Failed with result ‘exit-code’.  
> Apr 23 18:50:21 my.server.lan systemd[1]: snap.rocketchat-server.rocketchat-caddy.service: Service hold-off time over, scheduling restart.  
> Apr 23 18:50:21 my.server.lan systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-caddy.  
> Apr 23 18:50:21 my.server.lan systemd[1]: snap.rocketchat-server.rocketchat-caddy.service: Start request repeated too quickly.  
> Apr 23 18:50:21 my.server.lan systemd[1]: Failed to start Service for snap application rocketchat-server.rocketchat-caddy.  
> Apr 23 18:50:21 my.server.lan systemd[1]: snap.rocketchat-server.rocketchat-caddy.service: Unit entered failed state.  
> Apr 23 18:50:21 my.server.lan systemd[1]: snap.rocketchat-server.rocketchat-caddy.service: Failed with result ‘start-limit-hit’.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [April 23, 2019, 7:07pm UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/2 "2019-04-23T19:07:30Z")

</div>

There is absolutely no reason not to use SSL when you have Letsencrypt.

Read your logs… I think your issue is here

error presenting token: presenting with standard HTTP provider server: Could not start HTTP server for challenge -\> listen tcp :80: listen: address already in use

So what else runs on port 80??

---

<div class="post-metadata">

**Author:** ![max](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@max](https://forums.rocket.chat/u/max)\
**Post date:** [April 24, 2019, 5:25am UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/3 "2019-04-24T05:25:24Z")

</div>

Thanks for the reply. Sure, we have `apache2` on the same server, and the port 80 is taken up by it. But no matter which port I choose for Caddy, following [this guide](https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/autossl/#disabling-ssl-or-listening-on-custom-ports), nothing changes. Currently, my Caddyfile looks like this:

> [https://example-domain.com:3001](https://example-domain.com:3001) {  
> proxy / localhost:3000 {  
> websocket  
> transparent  
> }  
> }

i.e., I chose port 3001. Then I restart both the RC server and the caddy. Yet, caddy then fails again, with the same error that port 80 is already in use. It obviously ignores my port settings somehow.

However, if in the Caddyfile I change `https://example-domain.com:3001` to `http://example-domain.com:3001`, and restart the caddy, it starts fine without failing and listens to port 3001. But I need SSL to be enabled. What could be the problem here?

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [April 24, 2019, 8:58am UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/4 "2019-04-24T08:58:14Z")

</div>

Why are you using apache AND caddy?

The page says:

“Configure Caddy yourself or use another http proxy”

Note “OR”. One or the other. Not both.

Just do all your proxing with apache. There is no need for caddy. It is there for those who don’t already run apache or nginx.

Just let apache handle the SSL and proxing. There are examples on how to do that.

---

<div class="post-metadata">

**Author:** ![max](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@max](https://forums.rocket.chat/u/max)\
**Post date:** [April 24, 2019, 9:19am UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/5 "2019-04-24T09:19:07Z")

</div>

> Why are you using apache AND caddy?

Because apache was there for several years already for other services, and when installing Rocket.Chat via snaps, I just followed the docs which never mentioned to check (neither before nor during installation) if apache is there :). In fact, I had no idea what caddy is until yesterday when I installed RC.

Thanks for your replies. For now, I just changed apache’s port to 8080 and caddy works fine now. I’m not sure if it’s as easy to configure apache for Let’s encrypt as it is easy for caddy, so I’ll leave it as is for now.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [April 24, 2019, 6:00pm UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/6 "2019-04-24T18:00:02Z")

</div>

Hmmm. So a clear lesson in why you should not install stuff unless you know what it does.

And as you still haven’t learned, you now have two http web server/proxies when you only need one.

That is a waste of resources, and a great way to cause yourself more issues.

So you’ll end up somewhere/sometime with connection issues and some poor soul will try to help you, not for one moment thinking you would be mad enough to run two web servers/proxies.

And now you seem to have used Caddy to handle Letsencrypt as well? Not using SSL on Apache?

Set Apache as a proper reverse proxy for Rocket and use Letsencrypt with it. Easy enough with the dehydrated script or various others.

---

<div class="post-metadata">

**Author:** ![robbyoconnor](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/robbyoconnor/32/41_2.png) [@robbyoconnor](https://forums.rocket.chat/u/robbyoconnor)\
**Post date:** [April 24, 2019, 11:22pm UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/7 "2019-04-24T23:22:01Z")

</div>

Yes, Everything mentioned above is correct.

It is super important to understand what you’re doing when deploying software. That means reading ALL documentation BEFORE you install.

---

<div class="post-metadata">

**Author:** ![aaron.ogle](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/aaron.ogle/32/15_2.png) [@aaron.ogle](https://forums.rocket.chat/u/aaron.ogle)\
**Post date:** [April 25, 2019, 2:39am UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/8 "2019-04-25T02:39:30Z")

</div>

If you can’t move away from apache look at certbot for auto SSL with letsencrypt: [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [April 25, 2019, 8:18am UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/9 "2019-04-25T08:18:42Z")

</div>

I have long used dehydrated from here.

> **[dehydrated-io/dehydrated](https://github.com/dehydrated-io/dehydrated)**
>
> letsencrypt/acme client implemented as a shell-script – just add water

It was one of the first ‘simplified’ methods that didn’t need a pile of bloatware & dependencies. Just bash.

Still, it doesn’t fix the OPs double webserver issue 🙂

---

<div class="post-metadata">

**Author:** ![aaron.ogle](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/aaron.ogle/32/15_2.png) [@aaron.ogle](https://forums.rocket.chat/u/aaron.ogle)\
**Post date:** [April 25, 2019, 8:21am UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/10 "2019-04-25T08:21:05Z")

</div>

Never seen dehydrated before. That’s interesting.

> [@reetp](#):
>
> Still, it doesn’t fix the OPs double webserver issue

Yes for sure ditch the double proxy. Pick one and use it for all on the server. Don’t double complicate your life. It will cause you head aches for ever

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [April 25, 2019, 9:08am UTC](https://forums.rocket.chat/t/problems-configuring-ssl-with-snaps-caddy-fails-with-result-start-limit-hit/3670/11 "2019-04-25T09:08:59Z")

</div>

Dehydrated - was called letsencypt.sh I think but he got leaned on to change the name.

I think it was the first, or one of the first, simple implementations that didn’t need loads of other junk installed, some of which couldn’t be due to dependencies or versioning or whatever.

The hook scripting part makes it pretty powerful too.

Only thing I have ever used for letsencrypt certs !!
