Web with SSL enabled

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Web with SSL enabled

Post 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"
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Web with SSL enabled

Post 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 ???
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: Web with SSL enabled

Post by SeeCwriter »

It was the htm vs html extension. We've always used htm. I hadn't noticed that the index extension was changed.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Web with SSL enabled

Post 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
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: Web with SSL enabled

Post 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?
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: Web with SSL enabled

Post by TomNB »

Tools version?
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: Web with SSL enabled

Post by SeeCwriter »

2.9.3
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: Web with SSL enabled

Post 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";
User avatar
Forrest
Posts: 283
Joined: Wed Apr 23, 2008 10:05 am

Re: Web with SSL enabled

Post 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 3507 times
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
Post Reply