Page 1 of 1

Web with SSL enabled

Posted: Thu Oct 08, 2020 2:10 pm
by SeeCwriter
When my MOD5441X application is built with SSL Support enabled, the HTTP webpage won't load. I'm not using any secure features of SSL.
I've stripped my Ethernet code down to the following:

Code: Select all

void InitEnet()
{
  InitializeStack();
  GetDHCPAddressIfNecessary();
  OSChangePrio( USERMAIN_PRIO );
  EnableAutoUpdate();
  EnableTaskMonitor();
  StartHTTP();
  SetNewPostHandler( WebIncomingPost );
  OldHttpHandler = SetNewGetHandler( MyHttpHandler );
}

int MyHttpHandler( int sock, PSTR url, PSTR rxb )
{
  printf( "HTTP Using Old Handler for: %s, from: %s, with socket %d\r\n", rxb, url, sock );
  return OldHttpHandler(sock, url, rxb);   
}
[code]
When I attempt to load the page using Chrome, this is the result.
Output:  "HTTP Using Old Handler for: GET /index.html, from: index.html, with socket 31"

Re: Web with SSL enabled

Posted: Thu Oct 08, 2020 3:05 pm
by pbreed
What is your error 404 not found?

Note that the most recent tools changed the default page from index.htm to index.html.
You are trying to load index.html, does it exist?
Or is there only an index.htm ???

Re: Web with SSL enabled

Posted: Thu Oct 08, 2020 3:16 pm
by SeeCwriter
It was the htm vs html extension. We've always used htm. I hadn't noticed that the index extension was changed.

Re: Web with SSL enabled

Posted: Fri Oct 09, 2020 10:43 am
by pbreed
You can change it back with a flag if you want...
add -dindex.htm to the comphtml flags....
(Or and default page ie -dMySpecialPage.html

Re: Web with SSL enabled

Posted: Fri Oct 09, 2020 11:53 am
by SeeCwriter
The options box for comphtml is grayed-out and won't let me add any flags. Is there another method for adding this flag?

Re: Web with SSL enabled

Posted: Sat Oct 10, 2020 6:56 am
by TomNB
Tools version?

Re: Web with SSL enabled

Posted: Sat Oct 10, 2020 8:48 am
by SeeCwriter
2.9.3

Re: Web with SSL enabled

Posted: Sat Oct 10, 2020 9:12 am
by TomNB
The example in \nburn\examples\MOD5441X\MOD5441x-FactoryApp shows how that can be done. This is what I have used in the past.

extern const char *default_page; // default web page

void UserMain(void *pd)
{
InitializeStack();
OSChangePrio(MAIN_PRIO);
EnableAutoUpdate();
GetDHCPAddressIfNecessary();

StartHTTP();
default_page = "index.html";


That was to set the .html extension when .htm was the default, since most web developers use .html. For your purposes change it to:
default_page = "index.htm";

Re: Web with SSL enabled

Posted: Mon Oct 12, 2020 11:03 am
by Forrest
You can modify the comphtml flags directly. See screenshot Add the flag "-dindex.htm" if you want the default file to be index.htm instead of index.html
Screenshot_20201012_103850.png
Screenshot_20201012_103850.png (70.78 KiB) Viewed 8049 times