MapWinGIS TLS version supported

Hi,
We have been successfully returning client mapping data to display through MapWinGIS using a wmslayer. Suddenly this data stopped being displayed and we haven’t changed our code. One thing that has changed however is that the client has recently migrated their DNS hosting to a different provider and a consequence of this is that their webservices no longer support versions of TLS older than 1.2.

Does anyone know which version of TLS MapWinGIS supports? NB: I have been unable to track mapwingis through a network logger (fiddler) to determine this myself.

Thanks, Tom

Hi Tom,

I believe I had this exact problem with TLS versions. The good news is the solution is independent of MapWinGIS.

Just add the following to the “runtime” section of the application .config file:

<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSystemDefaultTlsVersions=false"/>

and that should fix it for you.

Rob H

Hi Rob,

Thanks for your reply. I had seen this possible solution elsewhere but unfortunately it has not solved the problem for us.

Thanks,
Tom

Hi Tom,

That’s strange - is this an open WMS that I could try?

Rob

Hi Rob,

The layers I am attempting to connect to are not all open WMS layers however we have been able to setup temporary access on a test url to mimic the setup, with just one of the layers for testing (the only one which is an open data layer).

The url is: https://api.emapsite.com/dataservicenoauth.svc/api/wms/mapwingis_test and the layer name is ‘OS Zoomstack Outdoor’. The layer is for the United Kingdom and should display at any scale. The url is enabled for one week from today (expiry 22/09/2022 00:00:00).

Any testing/help is much appreciated.

Regards,
Tom

Hi Tom,

I tried out the link and I can see it works in QGIS, but I haven’t got it to work in MapWinGIS yet - do you have an example, full url that should work, complete with SRS / boundingbox etc.

Regards,

Rob

Hi Rob,

Below is the code I was previously using to successfully load the layer in when I could get it to work:

Dim objExtents = New MapWinGIS.Extents
objExtents.SetBounds(-841259.0, 6405988.0, 0, 404314.0, 8733289.0, 0)

Dim objWmsLayer = New MapWinGIS.WmsLayer
objWmsLayer.DoCaching = False
objWmsLayer.UseCache = False
objWmsLayer.BaseUrl = “https://api.emapsite.com/dataservicenoauth.svc/api/wms/mapwingis_test
objWmsLayer.BoundingBox = objExtents
objWmsLayer.Epsg = 3857
objWmsLayer.Format = “image/png”
objWmsLayer.Layers = “OS Zoomstack Outdoor”
objWmsLayer.Name = “OS Zoomstack Outdoor”
objWmsLayer.Opacity = 255
objWmsLayer.TransparentColor = 255
objWmsLayer.UseTransparentColor = True
objWmsLayer.Version = tkWmsVersion.wvAuto

_WMSlayerhandle = EditMap.AddLayer(objWmsLayer, True)

I have never got it to load using epsg 27700 (British National Grid) but a bounding box set of extents for epsg 27700 would be objExtents.SetBounds(0, 0, 0, 700000.0, 1300000.0, 0). However, it only loaded up previously when specifying epsg 3857 and the associated extents for that.

Regards,
Tom

Hi Tom,

I tried your example above (converted to C#) and I just see nothing. When I hover over the map, the whole thing dies instantly. Is this the sort of thing you’re seeing?

Regards,

Rob

Hi Rob,

When I try to add the layer, the _WMSlayerhandle variable gets updated (implying the AddLayer mapwingis method has run) but the map remains as it is without any new OS layer being displayed. My map doesn’t die though, I can interact with it, just without the required layer being displayed.

Regards, Tom

Hi Tom,

The application crashing was a me problem. It’s now just like you describe. Seemingly valid, but does not display.

In our software here we have functionality to add WMS layers which works differently than your example (doesn’t use WMSLayer) and that is giving me a “Parameter is not valid” error when calling it.

Regards,

Rob

Hi Rob,

I appreciate your time investigating - it’s a shame we’ve both hit the same point.

I don’t know if you can share how you add wms layers but I’d be interested to know as I’ve only seen examples documented using the wmslayer class.

Regards, Tom

Hi Tom,

I’m beginning to feel like this might be a MapWinGIS problem. However you said it used to work (although there have been changes to the WMS). Have you upgraded MapWinGIS recently?

In any case, if I log the requests, I see entries like:

15:53:20.526: ERROR: 0; status 400 size 0 b https://api.emapsite.com/dataservicenoauth.svc/api/wms/mapwingis_test?request=GetMap&service=WMS&layers=OS Zoomstack Outdoor&crs=EPSG:3857&bbox=-130893.148438,6774174.291016,-128460.388672,6778719.800781&format=image/png&width=256&height=256&version=1.1.1&styles=

If you cut and paste the url into a browser from the above it actually works, so why is it saying, “ERROR”?

If I can make our way of doing things work, then I can see if I can share that with you, but it wouldn’t be my recommended way of doing it. I’m guessing it was done before native support was added.

Regards,

Rob

Hi Rob,

I think it’s good that the request in your log works in a browser as it shows we are building up the url as required.

In discussion with our data provider it was thought (see first post) that the issue might be a result of the WMS provider migrating their DNS hosting to a different provider, a consequence of which their webservices no longer support versions of TLS older than 1.2, with the suspicion being that MapWinGIS possibly uses TLS 1.1 or older.
That could explain why it continues to work in QGIS/browsers but no longer in MapWinGIS.

Tom

Hi Tom,

I’ve made some progress, I can now load the WMS in our software. The problem (in our software) was that it didn’t like that the STYLES parameter was being set to “default” it wanted it as “STYLES=”. Removing that made it load (and in EPSG:27700) I believe.

I am virtually certain the problem is not TLS versions, because:

  • I’ve got it to work
  • I use other WMS that only allow a minimum TLS of 1.2 and they work

I think there is probably a problem in MapWinGIS WMSLayer functionality because:

  • I can’t get other WMS that work in my software to work using your/MapWinGIS method of adding them (WMSLayer)

  • We now know it is possible for it to work with MapWinGIS in general

  • I note a number of issues have been raised previously where it was hoped updates would fix (similar sounding) problems, but there is no follow up to know if that was true.

Hopefully this is helpful. I can look into whether it’s worth sharing the alternative method code with you (and if I’m allowed), otherwise hopefully can talk you round it - however I might not be able to for a couple of days or so.

Regards,

Rob

Hi Rib,

It’s good you got it to display in your software.
I checked the styles variable in my wmslayer code and that is passed as a blank string so should be ok, and at least match up with what got to work.
What I still can’t work out is what has caused my implementation to stop displaying the map layers when we haven’t changed MapWinGIS versions or even the code that calls them.
I’ll keep investigating but please let me know if you are able to describe the method you were successful using.

Thanks, Tom

Hi Rob,

I was wondering if it was possible for you to share the method of how you got the wms layer to display in your implementation of MapWinGIS?

Thanks,
Tom

We managed to resolve this by setting it up as a custom tile provider and using a wmts link and discarding the previous work done using the wms layer class.

Regards,
Tom