For some Geoserver harvesters Geonetwork is blocked. I get a 403 error.
However, the same Geoserver can be consumed without problem from QGIS, and a simple GetCapabilities request from a web browser returns a valid XML document. After some troubleshooting with the aid of ChatGPT, we have concluded this:
The GeoServer is rejecting requests unless the User-Agent
mimics a browser (like Mozilla/5.0).
GeoNetwork’s harvester uses a non-browser user-agent, so it’s blocked with a 403 Forbidden
Is it possible to set the User-Agent in Geonetwork?
Compare these two requests
curl --ssl-no-revoke "https://mapsext.sgi.se/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities"
curl --ssl-no-revoke -H "User-Agent: Mozilla/5.0" "https://mapsext.sgi.se/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities"