I have not been able to get the example ssl program working on Windows 8.1 that is described in the Xojo article Web Standalone SSL. The program that was tried is the Example that is with Xojo 2014 r2.1 called SSLTest.xojo_binary_project.
The program has been tried in both compiled and IDE running mode, and I have tried different ports (usually 8081 from the article) and am not able to get this working.
Is there something that I am missing? Thanks for your thoughts.
It appears the certificate file has to be the same name as the executable but with the .crt extension. Since the debugger creates an executable named DebugSSLTest.exe, I changed the name of the supplied certificate file from SSLTest.crt to DebugSSLTest.crt and it worked. I assume that you are using the debugger method also.
By the way, I get a Build Step error up front because it is saying that it can’t copy the certificate to a none existent folder. So I just “Run-Paused” and copy the renamed certificate into the folder manually before running the standalone executable.
What I wrote worked for me using the IDE method. I don’t have a licensed version of Xojo. I stuck with 2012r1.2 as my last available licensed version. Therefore, I couldn’t test the “Build” method. The only thing I saw that looked odd was that the parameter for the “Build” method should have probably been “–secureport=8081” instead of “–secureport-8081” as it says in the example. However, I have no way to know for sure. It just looked odd because I doubt that the built version’s parameter would be any different than the IDE method’s parameter.
Ok, here the steps that I am doing for a build ssl file:
Copy ssltest project to D:\user\Xojo\Eugene\Web\Chapter23\ directory
Change Build Settings for Windows App Name to SSLTest in the Xojo IDE
First build of program to create build directory and libs in D:\user\Xojo\Eugene\Web\Chapter23\Builds - SSLTest.xojo_binary_project\Windows\SSLTest folder
copy SSLTest.crt from C:\Program Files (x86)\Xojo\Xojo 2014r2.1\Example Projects\Web\SSL to D:\user\Xojo\Eugene\Web\Chapter23\Builds - SSLTest.xojo_binary_project\Windows\SSLTest
drag SSLTest.crt from D:\user\Xojo\Eugene\Web\Chapter23\Builds - SSLTest.xojo_binary_project\Windows\SSLTest and drag to CopySSLCertWindows, and delete previous file path that was there
rebuild executable with updated data
open command prompt and move to D:\user\Xojo\Eugene\Web\Chapter23\Builds - SSLTest.xojo_binary_project\Windows\SSLTest directory
Expand Windows Build Target and move the CopyFilesStep to after the build step. If you don’t, the destination directory doesn’t exist yet and it will fail to copy. (We’ll have to get that project fixed)
In the IDE, change the port to something other than 80 (Shared->Build->Port). If you’re not an administrator, you can’t bind to a port below 1024 and the app may fail to load properly if you do.
Run the app from the command prompt using this code: SSLTest --secureport=8081 --maxsecuresockets=50
Make sure the app stays running. If an error occurs, it will be printed to the terminal window and your app will quit.
Use a browser to connect to the app: https://127.0.0.1:8081/
For what it’s worth, these steps work for me on my Windows 7 VM.
It’s also worth noting which browsers did and did not work:
From my Mac, Safari, Chrome and Firefox all connected fine (albeit complaining about the self-signed certificate)
On Windows 7, Chrome and Firefox connected fine (same complaints), Internet Explorer 11 did not.
Open SSLTest project
Enable Windows Build
Expand Windows Build Target and move the CopyFilesStep to after the build step. If you don’t, the destination directory doesn’t exist yet and it will fail to copy. (We’ll have to get that project fixed)
In the IDE, change the port to something other than 80 (Shared->Build->Port). If you’re not an administrator, you can’t bind to a port below 1024 and the app may fail to load properly if you do.
Run the app from the command prompt using this code: SSLTest --secureport=8081 --maxsecuresockets=50
Make sure the app stays running. If an error occurs, it will be printed to the terminal window and your app will quit.
Use a browser to connect to the app: https://127.0.0.1:8081/
For what it’s worth, these steps work for me on my Windows 7 VM.[/quote]
Thanks to both Greg and Randy. This is making progress and am getting closer, but not quite there yet.
Here are the modified steps that were used of Gregs:
Open SSLTest project
Enable Windows Build
Rename Windows App Name to SSLTest (otherwise the exe and crt name do not match, and the exe is My Application.exe)
Changed the port in Shared -> Build -> Port to 8081
Compiled Xojo Web App
Copied SSLTest.crt to C:\Users\Eugene\Desktop
ew\Builds - SSLTest\Windows\SSLTest\ folder
Opened CMD in C:\Users\Eugene\Desktop
ew\Builds - SSLTest\Windows\SSLTest\ folder
Ran app with SSLTest --secureport=8081 --maxsecuresockets=50
Browser provided the message: “Establishing Secure Connection…”
In Internet Explorer, the response is: ‘This page can’t be displayed’
The good news is that when attempting to rerun the program by retyping ‘SSLTest --secureport=8081 --maxsecuresockets=50’, the error ‘App is shutting down: Unable to bind to port 8081, port is already in use.’ To free the port the computer is rebooted.
This is on a native Windows 8.1 Pro machine, with Xojo 2014 r2.1, tested on Chrome and IE browsers.
I’ll give it a try on my native Windows 7 machine.