Forgot to say that it works with http but if I use https I get 401 unauthorized.