I'm developing a project using JavaScript, PHP and OpenLayers. A lot of maps are loaded using and HTTPS connection against an external OGC server.
When I try to load the map using HTTPS, they doesn't load (instead of, they show me an "Error loading the map, try again later").
I think that the problem is because of Digital Certificate. If I load directly from the server (using a WMS call) like this (look the last parameter):
The browser ask me for my authorization to see it. If I accept the Digital Certificate, I can see the map. After that, and because of my browser now accepts the certificate, I can see my own map from my own application.
I'm creating the layer like this:
activeLayer = new OpenLayers.Layer.WMS(
layername, layerurl,
{
width: varmap.size.w,
srs: varmap.projection,
layers: layername,
height: varmap.size.h,
styles: style,
format: 'image/png'
}
);
varmap.addLayer(activeLayer);
Is there any way to ask for the Digital Certificate manually when the user access to my web?
I'm using CodeIgniter to load views.
1 Answer 1
You can use a proxy on your server so all client requests are made to your server, which deals with the certificate, gets the request and passes it back to the client. For PHP have a look at http://tr.php.net/manual/en/function.openssl-verify.php
If you are also using WMS software (MapServer, GeoServer) you could implement the same technique using a cascading WMS server. This would act as an intermediary between the remote server and users' browsers.
For details on how to do this in MapServer see http://geographika.co.uk/setting-up-a-secure-cascading-wms-on-mapserver
Note - using a proxy in this manner may go against the original WMS terms of agreement, so remember to check these first.
-
The servers aren't belong to me, so I can't implement a cascading WMS server. Probably, I'm going to add a new option to my web ('Use security connection') to allow the users get the maps using HTTPS. Thus, the user can select if want to use digital certificates or not. Thanks!Fran Verona– Fran Verona2011年01月31日 12:17:49 +00:00Commented Jan 31, 2011 at 12:17
-
1It doesn't matter if you don't own the original server - the cascading WMS would be set up on any server you can configure.geographika– geographika2011年01月31日 13:38:04 +00:00Commented Jan 31, 2011 at 13:38
-
I didn't know that :P I'm going to talk with my OGC technical engineer and try to tell him what you told me. Thanks!Fran Verona– Fran Verona2011年01月31日 21:13:59 +00:00Commented Jan 31, 2011 at 21:13