rejetto forum

How about SSL support

Guest · 136 · 159150

0 Members and 2 Guests are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile

Offline Teekay

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Hiho!

I use hfs for about 1 year without bigger problems! Read a lot in this forum and found a lot of answers.
But now I need an advice.

A few days ago I installed stunnel. I used the explanation of Gees and the wiki, everything worked out well!
...exepct the forwarding from hfs:80 to hfs:443(stunnel).

To use hfs:80 for linking to hfs:443 I need to open 2 different instances of hfs, as I've learned.
So I've unchecked menu>start/exit>'Only 1 instance' and then tried two different ways for opening a second instance:
- just opened the same hfs.exe once again
- made a copy of the hfs-folder: C:\Programme\hfs\... and C:\Programme\copy of hfs\...

Even with the second way I ended with the same problem:
If I change something in one of the VFS it is changing in the other instance either. Same for the template...

Both instances are obviously not independent.
But isn't it necessary if i want to have two different hfs-contents (hfs:80 -> only a link to https; hfs:443 -> my files)?
What is my error in reasoning?
Can someone give me an advise for that?
Thank you!  ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i think there's something strange in what you are asking.
i don't see why :80 should "link" :443
if you need to have 2 different contents, and having 2 folders is not feasible, then you need 2 instances, yes.
although, you may be wrong about it not being feasible ;)


Offline Teekay

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Well I just wanted to have http://myserver:80/ as a "start page" without any content but a link to my https://myserver:443/

Am I wrong with my question?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
does the available guide cover this?
AFAIremember, most people using stunnel is just not accepting connections on 80.

what you want is possible, but maybe just not explained anywhere.
not very easy, to be honest.

so you should have something like this in the diff template (requires HFS 2.3 #236)

{.if|{.%ip% != 127.0.0.1.}|{:{.add header|Location: http://youraddress:443.}:}|{:{.section||back=1.}:}/if.}


not tested!


Offline Teekay

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I haven’t found any explanations for this but I thought it would be such a simple question no one else has needed to ask for ;)

Surly I’m not the expert to solve this ‘problem’ if it’s necessary to create new code or stuff like that.
Maybe there will be a solution in the near future. I'll keep it in mind.

Thank u for your attention so far :D


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
err... i just told you the solution, and made the code for you :)


Offline Teekay

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
 ;D Hrhrhrrhr! OK, I've understood I would require hfs2.3 #236...

I've read your text again but still don't see what to do.

What does the code mean? (okok not urgently needed to know - if it works, hrhrhr)
Where do I have to put the code? In the template of the hfs:443 because it has something to do with the header of the stunnel/hfs?
And when I've added the code at the right place I can run two different hfs instaces (in seperated folders) with two different VFS ...that's it?

Still full of questions...I fear it will take us some time  ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
run hfs
right click on home/root
properties
diff template
paste the code there

Quote
And when I've added the code at the right place I can run two different hfs instaces (in seperated folders) with two different VFS ...that's it?

no. that's not what you asked. you said you want to use stunnel. it's stunnel on 443, and there's only 1 hfs, port 80.
stunnel is a bridge, that will tunnel the connection between 443 and 80.


Offline Teekay

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I think we talk at cross-purposes. Maybe I have not made clear what I have already got and what's my problem. Sorry.

What I have got:
- a running stunnel connection
- a running hfs instance on port 44300 reached by https://mydynIP/

What I want to have:
- an additional instance of hfs which listens to port 80 and can be reached by http://mydynIP. This additional hfs:80 should only act as a start page with a link to my https://mydynIP/ for those people who forget to type the extra s in https. No other content should be accessible. Actual a simple html-page would be enough.

My poblem when I run two instances of hfs:
- if I change the VFS in one instance, it automatically changes the VFS of the other instance
- the same with the template. I cant run two different templates on the two hfs instances

I hope I could make it clear now.


Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile
Maybe put HFS, the vfs, and the template you want to use in 2 different folders.  Then run them both from two different locations from your hard drive.  All files should then stay seperate.  Might work.
maverick


Offline Teekay

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I had one hfs (+ SavedOptions.vfs + template_xyz.tpl + hfs.ini) in
C:\Programme\hfs_443\hfs443.exe

and the other (w/o other files) in
C:\Programme\hfs_80\hfs80.exe

(Did not work)

I can try with additional files in the second folder. But w/o the hfs.ini, right?
Or do I have to modify the .ini manually?


Offline Teekay

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I modified hfs.ini in the hfs_80 folder.
Works for the moment...still testing.  :)


Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile
Good to hear it's working.  Yes you would need the hfs.ini in there too and configured correctly for the folder.  HFS has to be able to find the files it uses.
maverick


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
What I want to have:
- an additional instance of hfs which listens to port 80 and can be reached by http://mydynIP. This additional hfs:80 should only act as a start page with a link to my https://mydynIP/ for those people who forget to type the extra s in https. No other content should be accessible. Actual a simple html-page would be enough.

you DON'T need to have 2 hfs to do this.
to apply my solution you only need first to change HFS to port 80, configure your router to forward port 80, change stunnel configuration from port 44300 to 80.
after this, you can apply my solution with 1 HFS.