# MapWinGIS TLS version supported

**URL:** <https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408>\
**Category:** MapWinGIS\
**Created:** [September 7, 2022, 2:04pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408 "2022-09-07T14:04:57Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 7, 2022, 2:04pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/1 "2022-09-07T14:04:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robhoney](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@robhoney](https://mapwindow.discourse.group/u/robhoney)\
**Post date:** [September 12, 2022, 2:37pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/2 "2022-09-12T14:37:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 14, 2022, 3:13pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/3 "2022-09-14T15:13:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robhoney](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@robhoney](https://mapwindow.discourse.group/u/robhoney)\
**Post date:** [September 15, 2022, 10:27am UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/4 "2022-09-15T10:27:57Z")

</div>

Hi Tom,

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

Rob

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 15, 2022, 1:19pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/5 "2022-09-15T13:19:31Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![robhoney](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@robhoney](https://mapwindow.discourse.group/u/robhoney)\
**Post date:** [September 19, 2022, 3:13pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/6 "2022-09-19T15:13:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 20, 2022, 7:44am UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/7 "2022-09-20T07:44:42Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![robhoney](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@robhoney](https://mapwindow.discourse.group/u/robhoney)\
**Post date:** [September 20, 2022, 12:30pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/8 "2022-09-20T12:30:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 20, 2022, 12:40pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/9 "2022-09-20T12:40:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robhoney](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@robhoney](https://mapwindow.discourse.group/u/robhoney)\
**Post date:** [September 20, 2022, 1:21pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/10 "2022-09-20T13:21:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 20, 2022, 2:18pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/11 "2022-09-20T14:18:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robhoney](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@robhoney](https://mapwindow.discourse.group/u/robhoney)\
**Post date:** [September 20, 2022, 3:02pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/12 "2022-09-20T15:02:50Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 20, 2022, 3:23pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/13 "2022-09-20T15:23:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robhoney](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@robhoney](https://mapwindow.discourse.group/u/robhoney)\
**Post date:** [September 20, 2022, 5:25pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/14 "2022-09-20T17:25:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [September 21, 2022, 2:31pm UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/15 "2022-09-21T14:31:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [October 4, 2022, 10:04am UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/16 "2022-10-04T10:04:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tbxais](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@tbxais](https://mapwindow.discourse.group/u/tbxais)\
**Post date:** [November 8, 2022, 9:15am UTC](https://mapwindow.discourse.group/t/mapwingis-tls-version-supported/1408/17 "2022-11-08T09:15:22Z")

</div>

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
