Error 405

I am using the GeoServer and i am having the problem : Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure image ‘’. This request has been blocked; the content must be served over HTTPS.
405 Mixed Content: The page at ‘https://localhost:****/’ was loaded over HTTPS, but requested an insecure image . This request has been blocked; the content must be served over HTTPS.
This happens when i try to insert the photo from the GeoServer into the map using the openlayers library with javascript, this is the script:

function LoadOrto(layerName, ortofoto) {
    var url = 'http://*****:***0/geoserver/****/wms'; 
    var espacoTrabalho = '***';

    var groupTiff = new ol.source.TileWMS({
        url: url,
        params: { 'LAYERS': `${espacoTrabalho}:${ortofoto}`, 'TILED': true },
        serverType: 'geoserver',
        crossOrigin: 'anonymous'
    });
    
    var tiffLayer = new ol.layer.Tile({
        maxResolution: map.getView().getMaxResolution() / 16,
        source: groupTiff,
    });

    tiffLayer.setZIndex(0);
    tiffLayer.set('name', layerName);

    map.addLayer(tiffLayer);
    tiff.push(groupTiff);
}

$(document).ready(function () {
    GetOrtofoto();
});

What can i do to fix it and properly shows the photo?

Hello @Ricks and thanks for joining us on the user forum.

I edited your post to use markdown code formatting so I could read the example okay.

I have a question:

var url = 'http://*****:***0/geoserver/****/wms';

Isn’t this the answer to your question? OpenLayers is going to use that URL to try and figure out how to make GetMap requests?

You should also double check that your proxy base url is configured with the same https://*****.***/geoserver domain name as the URL above.

You may need to ask on the openlayers.org.

I was trying any possible way to make it to work from https to the geoserver http. In the end i saw that it wa possibly gonna give me too many problems and updated my own server server into the http file and it worked as intended, just needed some cors configuration but it has worked as intended. Thanks for the help

That is a very common activity, with two options:

  • Recommend: Apache (or NGINX) with a certificate for HTTPS, setup a proxy to GeoServer. Make sure to update GeoServer settings with Proxy Base URL setting so it can produce the right output.
  • Alternate: configure tomcat with certificate for https (or configure jetty with certificate for https)