I have contacted my hosting provider and they suggested that something went wrong when I installed the ssl certificates a few years back altough the website seemed to work ok all this time.
About a year ago my hosting provider was taken over by another company and the website was migrated by them, maybe that had also caused some problems.
Anyway, they advised me to run the plugin really-simple-ssl to correct any existing problems, and that worked.
All seems to be working as it should.