diff --git a/src/core/proj/qgscoordinatereferencesystem.cpp b/src/core/proj/qgscoordinatereferencesystem.cpp
index d40b967cb34d..8fab7ce577ad 100644
--- a/src/core/proj/qgscoordinatereferencesystem.cpp
+++ b/src/core/proj/qgscoordinatereferencesystem.cpp
@@ -1633,7 +1633,7 @@ QString QgsCoordinateReferenceSystem::toOgcUrn() const
   if ( parts.length() == 2 )
   {
     if ( parts[0] == QLatin1String( "EPSG" ) )
-      return  QStringLiteral( "urn:ogc:def:crs:EPSG:0:%1" ).arg( parts[1] );
+      return  QStringLiteral( "urn:ogc:def:crs:EPSG::%1" ).arg( parts[1] );
     else if ( parts[0] == QLatin1String( "OGC" ) )
     {
       return  QStringLiteral( "urn:ogc:def:crs:OGC:1.3:%1" ).arg( parts[1] );
diff --git a/tests/src/python/test_qgsserver_wfs.py b/tests/src/python/test_qgsserver_wfs.py
index ec5ffcfcb948..37503a36131c 100644
--- a/tests/src/python/test_qgsserver_wfs.py
+++ b/tests/src/python/test_qgsserver_wfs.py
@@ -787,7 +787,7 @@ def test_getFeatureFeatureJsonCrs(self):
         jdata['features'][0]['geometry']
         jdata['features'][0]['geometry']['coordinates']
         self.assertEqual(jdata['features'][0]['geometry']['coordinates'], [807305, 5592878])
-        self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG:0:3857")
+        self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG::3857")
 
         query_string = "?" + "&".join(["%s=%s" % i for i in list({
             "SERVICE": "WFS",
@@ -836,7 +836,7 @@ def test_getFeatureFeatureJsonCrs(self):
         jdata['features'][0]['geometry']
         jdata['features'][0]['geometry']['coordinates']
         self.assertEqual([int(i) for i in jdata['features'][0]['geometry']['coordinates']], [361806, 4964192])
-        self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG:0:32632")
+        self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG::32632")
 
         query_string = "?" + "&".join(["%s=%s" % i for i in list({
             "SERVICE": "WFS",
@@ -854,7 +854,7 @@ def test_getFeatureFeatureJsonCrs(self):
         jdata['features'][0]['geometry']
         jdata['features'][0]['geometry']['coordinates']
         self.assertEqual([int(i) for i in jdata['features'][0]['geometry']['coordinates']], [812191, 5589555])
-        self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG:0:3857")
+        self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG::3857")
 
     def test_insert_srsName(self):
         """Test srsName is respected when insering"""
diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt
index 445b318673b2..32601b53d9cf 100644
--- a/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt
+++ b/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt
@@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
   "crs":
     {
       "properties": {
-        "name": "urn:ogc:def:crs:EPSG:0:3857"
+        "name": "urn:ogc:def:crs:EPSG::3857"
       },
       "type": "name"
     },
diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt
index d8984c9030cc..5a4f50fae474 100644
--- a/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt
+++ b/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt
@@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
   "crs":
     {
       "properties": {
-        "name": "urn:ogc:def:crs:EPSG:0:3857"
+        "name": "urn:ogc:def:crs:EPSG::3857"
       },
       "type": "name"
     },
diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt
index 3b9f8db9af7c..f689decdd3f5 100644
--- a/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt
+++ b/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt
@@ -5,7 +5,7 @@ Content-Type: application/geo+json; charset=utf-8
   "crs":
     {
       "properties": {
-        "name": "urn:ogc:def:crs:EPSG:0:3857"
+        "name": "urn:ogc:def:crs:EPSG::3857"
       },
       "type": "name"
     },
diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt
index 5204b6fe23f0..0b3086fffcbf 100644
--- a/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt
+++ b/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt
@@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
   "crs":
     {
       "properties": {
-        "name": "urn:ogc:def:crs:EPSG:0:3857"
+        "name": "urn:ogc:def:crs:EPSG::3857"
       },
       "type": "name"
     },
diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt
index 41cc8910893c..412cecb0f26a 100644
--- a/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt
+++ b/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt
@@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
   "crs":
     {
       "properties": {
-        "name": "urn:ogc:def:crs:EPSG:0:3857"
+        "name": "urn:ogc:def:crs:EPSG::3857"
       },
       "type": "name"
     },
diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt
index a8709da01519..f92da7243e8a 100644
--- a/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt
+++ b/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt
@@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
   "crs":
     {
       "properties": {
-        "name": "urn:ogc:def:crs:EPSG:0:3857"
+        "name": "urn:ogc:def:crs:EPSG::3857"
       },
       "type": "name"
     },