Switched PIWIK to SSL, now archiving is not working anymore

To keep track of SSL websites we had to switch PIWIK to SSL also.
Everything seemsto be working ok, until the point i want to archive.
I tried to archibe with URL and locally with Windows Task Manager, but reports are not generated.
This is the log i get:

X-Powered-By: PHP/7.1.1
Date: Wed, 01 Mar 2017 10:45:48 GMT
Content-Type: text/plain;charset=UTF-8
Vary: Accept-Encoding
Server: Microsoft-IIS/8.5

INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] ---------------------------
INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] INIT
INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] Running Piwik 3.0.1 as     Super User
INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] ---------------------------
INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] NOTES
INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] - Reports for today will be processed at most every 3600 seconds. You can change this value in Piwik      UI > Settings > General Settings.
INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] - Reports for the current week/month/year will be refreshed at most every 3600 seconds.
INFO CoreAdminHome[2017-03-01 10:38:57] [ab6d2] - Archiving was last executed without error 1 dagen 2 uren ago
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] - Will process 19 other websites because the last time they were archived was on a different day (in the website's timezone) , IDs: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] - Will process 8 other websites because some old data reports have been invalidated (eg. using the Log Import script) , IDs: 1, 2, 4, 5, 6, 8, 9, 11
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] ---------------------------
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] START
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] Starting Piwik reports archiving...
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] Day has finished for website id 1 since last run
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] Will pre-process for website id = 1, period = day, date = last52
INFO CoreAdminHome[2017-03-01 10:38:58] [ab6d2] - pre-processing all visits
ERROR CoreAdminHome[2017-03-01 10:39:19] [ab6d2] Empty or invalid response 'Got invalid response from API request: https://stats.dirkzwager.nl/?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp&token_auth=removed. Response was 'curl_exec: Failed to connect to stats.dirkzwager.nl port 443: Timed out. Hostname requested was: stats.dirkzwager.nl'' for website id 1, Time elapsed: 21.518s, skipping

The rest of the websites give the same error.
I have a http to https redirection on the website, tried the force_ssl in the config, all to no avail.
If i call https://stats.dirkzwager.nl/?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp&token_auth=xxxxxxx in a browser manualy, it looks like the stats are generated.

Can anyone help me out on this one?
Thanks in advance!

Edit:
Just saw there was an update available to 3.0.2. Ran that, still same problem.

Ok solved it.
I had to put the piwik url in the hosts file of my server.
When I did that everything went smooth again.