简体   繁体   English

通过HTTPS 443进行Java远程日志记录

[英]Java Remote Logging through HTTPS 443

If I have a java applet for a site, is it possible to do remote logging through HTTPS? 如果我有一个网站的Java小程序,是否可以通过HTTPS进行远程日志记录? how does this work? 这是如何运作的?

I know there is java sockethandler, which could direct the log to a server, but what should I do in the server side, so I can get the log and save it to a file in the server. 我知道有Java套接字处理程序,可以将日志定向到服务器,但是我应该在服务器端执行什么操作,以便获取日志并将其保存到服务器中的文件中。 I try to create a logserver app and put it on server but if I specify port 443, it will say 我尝试创建一个日志服务器应用并将其放在服务器上,但是如果指定端口443,它将显示

 `java.net.BindException: Address already in use: JVM_Bind`

Can someone point me out and give some examples what should I do in the applet side and server side? 有人可以指出我的例子,并在小程序和服务器端做些什么吗?

On that server TCP port 443 is already in use - therefore you have to use a different port. 该服务器上的TCP端口443已在使用中-因此您必须使用其他端口。

SSL does work on any port - 443 is just the standard port for HTTPS. SSL可以在任何端口上运行-443只是HTTPS的标准端口。 Therefore if you start your SSLServerSocket you can bind it to any port. 因此,如果启动SSLServerSocket,则可以将其绑定到任何端口。

If your applet used port 1234, then in your Applet you can use an SSLSocket instance and let it connect to your server URL and port. 如果您的小程序使用端口1234,则在小程序中,您可以使用SSLSocket实例并将其连接到服务器URL和端口。

Note that most likely you are using a self-signed certificate. 请注意,很可能您正在使用自签名证书。 In that case you have to embed the custom certificate in your applet and set it as trusted certificate when opeing the SSL connection. 在这种情况下,您必须将自定义证书嵌入到applet中,然后在进行SSL连接时将其设置为受信任的证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM