Forum Discussion

squintr_86994's avatar
squintr_86994
Icon for Nimbostratus rankNimbostratus
Feb 29, 2008

HTTPS rewrite host?

I'm new to irules and I'm hoping someone can help me out.

 

 

We're trying to prevent certificate errors by rewriting the host part with the FQDN so that it matches the name on the certificate (in the event that users access the website internally by the simple name of say "webmail"). If I create an irule to do this..eg:

 

 

when HTTP_REQUEST {

 

if {[getfield [HTTP::host] ":" 1] ne "website.domain.com"} {

 

HTTP::redirect https://website.domain.com[HTTP::uri]

 

}

 

}

 

 

It seems that it hits the cert before it hits the irule (and this giving an error about the name not matching). Any suggestions?
  • Hi,

     

     

    your stuff will work if they try to reach first your webmail through http://webmail.

     

     

    Then you should be able to redirect the user properly on https://webmail...

     

     

    But if the client tries to reach your webmail with https://webmail. Then it won't work because it will be too late. SSL certificates are exchanged before any HTTP transaction occurs.