oauthprovider does not works on a https server
| From: | LI Daobing | Date: | Wed, 27 Oct 2010 09:36:59 +0000 |
| Subject: | oauthprovider does not works on a https server | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-7792@lists.php.net to get a copy of this message | ||
Hello,
cc me on reply, I does not subscribe to this list, thanks.
I found that oauthprovider (r304239 from
http://svn.php.net/repository/pecl/oauth/trunk)
does not works on a
https server,
after inspect on the OAuthException, it sounds that if construct a url
with http://domain.nam/path instead of https://domain.nam/path
a workaround for this is add following line in your apache virtualHost config
SetEnv HTTP_X_FORWARDED_PROTO https
after inspect provider.c, I found that it use a strange way to inspect
whether the protocol is https or http, how about the https server is
not open on port 443?
thanks
$ grep -C 3 443 provider.c
if(proto && Z_STRLEN_PP(proto)) {
spprintf(&tmp, 0, "%s://%s%s",
Z_STRVAL_PP(proto), Z_STRVAL_PP(host), Z_STRVAL_PP(uri));
} else {
spprintf(&tmp, 0, "http%s://%s%s",
Z_LVAL_PP(port)==443?"s":"", Z_STRVAL_PP(host), Z_STRVAL_PP(uri));
}
return tmp;
}
--
Best Regards
LI Daobing