Moderator: moderators
392 /**
393 * Rewrites the URL by changing the host and port.
394 *
395 * @param urlToRewrite The URL to rewrite.
396 * @param urlWithHostAndPort Use host and port from this URL.
397 * @return The rewritten URL, or an unchanged URL if either argument is not a proper URL.
398 */
399 public static String rewriteUrl(String urlToRewrite, String urlWithHostAndPort) {
400 if (urlToRewrite == null) {
401 return null;
402 }
403
404 try {
405 URL urlA = new URL(urlToRewrite);
406 URL urlB = new URL(urlWithHostAndPort);
407
408 URL result = new URL(urlA.getProtocol(), urlB.getHost(), urlB.getPort(), urlA.getFile());
409 return result.toExternalForm();
410 } catch (MalformedURLException x) {
411 return urlToRewrite;
412 }
413 }
<Connector port="4330" minSpareThreads="5" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="/var/lib/tomcat6/webapps/tckey.pfx" keystorePass="MYPASS"
keystoreType="PKCS12"
clientAuth="false" sslProtocol="TLS"/>
anitract wrote:This still seems to to be an issue in the latest version (3.. I've been trying to get subsonic working through apache's ssl authentication, but experience the same thing as the parent poster...it appears there are hard-coded http links which break my https connection when they are hit.
If relative URLS are not going to be used, I was considering using http://apache.webthing.com/mod_proxy_html/ to change the http references on the fly. I was also looking into using tomcat's ssl, but I like the idea of keeping everything together in apache.
Anyone have a different work around?
Users browsing this forum: No registered users and 24 guests