Problem with Digital Certificates using OpenLayers and Javascript - php

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):
https://serverurl/ogc/wms?service=WMS&version=1.1.0&request=GetMap&layers=ms1:lp_anual_250&styles=&bbox=205125.0,3150125.0,234875.0,3199875.0&width=306&height=512&srs=EPSG:4326&format=application/openlayers
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.
So, the question is: Is there any way to ask for the Digital Certificate mannually when the user access to my web?
Thanks in advance!
PS: solutions using PHP are welcome too because I'm using CodeIgniter to load views

You could try opening the WMS URL in a div or perhaps a hidden iframe - that may cause the browser to pop up its 'Unknown cert' dialogue.

Im going to quote another user (geographika) from gis.stackexchange. I hope can help to someone with my issue:
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.
For details on how to do this in
MapServer see
http://geographika.co.uk/setting-up-a-secure-cascading-wms-on-mapserver

Related

Can I use the native android camera in phonegap over an iframe and send pictures on my webserver?

I am building an app and because of my missing knowledge of java and Xcode I decided to make this app in HTML,PHP,CSS & javascript(jquery). Now I'm facing the problem of getting this app to the different devices and I want to use PhoneGap for that. I placed an index.html inside the server for the app and there is an iframe placed inside and nothing more. Is it still possible for me to get access to the media storage and send PHPdata back and forth while having an iframe as a bridge between PhoneGap on android and my website on its web server? Can I access the camera of the device?
The short answer: No, and you shouldn't try that.
The long answer (And the safer one) is to use postMessage as described in MDN, do it in a different way could cause inconsistency between devices (Remember how fragmented is android and how painful could be the backward compatibility with 4.3 and below)
So, you could get the iFrame element and then post a message like
otherWindow.postMessage(InfoToSend, "*");
In the same way, you could listen to that event inside the frame:
window.addEventListener("message", receiveMessage, false);
This will no cause cross-frame issues and it will be the safer way to pass information between the frames, this work in both directions, so you could ask (From inside your iFrame) to use some native feature (plugin), listen to this event in your device main app, executed what you need and after that send a postMessage (from your app) to your iFrame with the result (a base64 img for example)
If you are trying to pass the window.cordova the instance or something similar, it won't work, so you will need to establish a conversation between the iFrame and the window.top frame.

PHP URL Encoding (FileMaker IWP)

I have hosted a FileMaker database on the web using FileMaker Instant Web Publishing. I am trying to access it directly - as in bypass the login page - using the php command header().
This is the code I am currently using.
header("location: http://<serverIPaddress>/fmi/iwp/cgi?dbpath=%2Ffmi%2Fiwp%2Fcgi%3F-db%3D<databasename>%26-startsession&acct=account&name=<username>&password=<password>&login=Login&-authdb");
I got this code from here: http://lnx.acidsoft.net/problemsolved/bypass-filemaker-iwp-login-via-url.html
I don't believe the FileMaker part is as relevant, since accessing the database works fine when I remove all the other encoding stuff, I just can't bypass the login that way.
I believe it might be more of a problem with how the URL is structured and me not having enough experience to know how certain browsers or what language I'm using will affect the URL.
When I currently try to execute it, I get two dialog boxes.
First, I get one that says:
Bad Request
The server could not process your request due to a missing command: "”.
The second one says:
Bad Request
The server could not process your request because your session has timed out, been closed, or communication with the server has been lost.
Please reselect the database to begin a new session.
If you cannot open the database, please contact your database administrator.
Any ideas? I am using a button to call the .php file that calls this particular line, and I'm testing it on Safari and Google Chrome.
Kevin, I had same exact problem. Found an example of a working link here:
https://community.filemaker.com/thread/73562?start=0&tstart=0
...and the difference with my (failed) URL was the = in the url should be encoded to %3D
For me, having the actual = symbol made the link not work.
http://<DATABASE IP OR HOSTNAME>/fmi/iwp/cgi?dbpath=%2Ffmi%2Fiwp%2Fcgi%3F-db%3D<DATABASE NAME>%26-startsession&acct=account&name=<USERNAME>&password=<PASSWORD>&login=Login&-authdb
Good luck!

authorize.net response_url https/http issue

Authorize.net consumes my response_url, which is on HTTP, into their HTTPS hosted dll. How can I specify that their dll should be on HTTP, so that my CSS and JS files get pulled in correctly?
I don't have a way of getting access to an SSL host at the moment.
Edit: First, we send from HTTP to their HTTPS hosted form. On their server. Then, their server consumes our HTTP page and dispalys it in their HTTPS response dll.
I only want their response_dll to be on HTTP. I don't see a security issue with that, and imagine there is a way to do this, as their service offering is meant for people without SSL enabled.
Edit2: I'm using their Simple Checkout API.
Answering my own question, based on some advice to contact tech support directly. I did, and their response was:
"We can only relay the html content. We do not offer to relay other content such as images. It is necessary that any images you want to include are hosted using https."
Edit --
I attempted to include a single logo image as a base64 string inside a static html page. That failed with a "script timeout". I speculate this is due to the size of the html file after using that string.
This is a total failure on the part of Authorize.Net

How does link with href parameter like "ymsgr:sendim?username" works, what kind of header does it send

I want to make php script that replace the execution of this kind of a link:
YM! Iron Man
So when the php script is called/executed, it will open Yahoo Messenger application window that prepared to send IM to tonystark.
Can I use header instead? but what type of header it would be?
The ymsgr is a custom protocol that is configured to start Yahoo Messenger, which is able to parse appropriate parameters following the ":".
This question (how do I create my own URL protocol?) may be relevant as it shows how it is possible to add custom URL protocols. The example is for Windows only but it must be a similar approach for other operating systems.
To make a story short, ymsgr: opens Yahoo Messenger because your system can recognize it and that Yahoo Messenger is its associated action.
The ymsgr in the link is a predefined protocol on your PC. Just like http, https and ftp are protocols known to your system. If you want to create custom protocols to be handled by the pc of your visitor, you must have them install something that will add the protocol to the system. Only then will the pc know what to start.
A good example of a non-standard installed protocol is skype. The links to add a user to your skype or chat with them only works if the visiting person has Skype installed. Otherwise an error occurs on the computer; "I don't know this protocol, what to do?"
So using a header to replicate the link will not work. Simply because your PC will not understand a header; it will only understand links to protocols, as if you are opening a page (http,https), email application (mailto), ftp programme (filezilla, unless handled by browser) etc etc.

Is it preferable to retrieve information directly from one site or through my web server using php?

I have an application that retrieves some info and give them to user from a certain public website. However, i am not sure whether i should let my app immediately connect to the target website or it should get the info through my web server using a simple PHP script (JSON).
Actually I am using Jsoup to get the information and I tried both and they worked perfectly ( immediate and PHP) using Jsoup. However, I have not published my app yet due to the confusion aforementioned.
Use the web service. If your client has logic to parse the HTML, it can break when the web page changes. The web service can absorb this change and make corrections, but your client cannot. Not unless you release another version of your app, and that can be a pain.

Categories