C / C ++对CXF服务器的SSL请求(C/C++ SSL Request to CXF Server)
首先,我使用cxf-spring-json-tomcat开发了一个Web服务器。 虽然,我创建了JKS密钥库文件并配置了我的tomcat服务器以使用SSL连接。 而且,我可以使用chrome,firefox向我的服务器请求。
我的服务器Bean:
@Service @Path("/tservice") public class TestService { @GET @Path("/{message}") @Produces("application/json") public Response find(@PathParam("message") String message) { Result result = new Result(); result.setMessage(message); result.setResultId(Math.random()); return Response.status(Status.OK).entity(result).type(MediaType.APPLICATION_JSON).build(); } }
Tomcat server.xml(SSL)
<Connector port="8443" protocol="HTTP/1.1" maxThreads="200" SSLEnabled="true" scheme="https" secure="true" keystoreFile="/home/**/.keystore" keystorePass="123456" clientAuth="false" sslProtocol="TLS" />
我的问题是(对于服务器端)我必须在我的java类中为ssl进行另一个配置或添加代码部分?
客户方面的另一个问题是:
我需要使用SSL连接开发C / C ++客户端应用程序。 我应该考虑什么? 他们有什么窍门吗? 任何建议,示例或教程?
非常感谢你。
First of all, I have developed a web server by using cxf-spring-json-tomcat. Although, I created JKS keystore file and configured my tomcat server for using SSL connection. And, I can request to my server by using chrome, firefox.
My Server Bean:
@Service @Path("/tservice") public class TestService { @GET @Path("/{message}") @Produces("application/json") public Response find(@PathParam("message") String message) { Result result = new Result(); result.setMessage(message); result.setResultId(Math.random()); return Response.status(Status.OK).entity(result).type(MediaType.APPLICATION_JSON).build(); } }
Tomcat server.xml (SSL)
<Connector port="8443" protocol="HTTP/1.1" maxThreads="200" SSLEnabled="true" scheme="https" secure="true" keystoreFile="/home/**/.keystore" keystorePass="123456" clientAuth="false" sslProtocol="TLS" />
My question is that(for server side) I have to make another configuration or add code part for ssl in my java classes?
Another question for client side is that;
I need to develop C/C++ client application by using SSL connection. What should I consider? Are there any tricks for them? Any suggestion,example or tutorial?
Thank you very much.
原文:https://stackoverflow.com/questions/30024881
最满意答案
Config.php在另一个目录中
Config.php was in a different directory
相关问答
更多-
如果您只是链接到每个页面,我认为它不可能。 你可以做的是通过ajax进行页面更改。 像这样的东西: $("#home").click(function() { $.ajax("index.php?p=home") .done(function(pageHtml) { $("#content").html(pageHtml); }); }); 到home的链接有id="home"并替换$(" ...
-
1)每个包含/要求声明被包含/必需文件的内容所取代。 包含文件本身的内容正在成为执行脚本的一部分,但是如果它成为HTML响应的一部分,则取决于内容本身。 2)除非你有很多访问者,否则你几乎不会注意到包含一个大文件和几个较小文件的区别。 然而,它的好做法是只包含实际需要的部分,因为这样可以节省Web服务器的内存和资源,从而在发生大量请求时可能会出现问题。 3)包含代码的位置并不重要。 由于纯粹的组织原因,尽可能在脚本的开始部分包含所有内容,但有时这是不可能的,这意味着您经常会看到代码包含在函数内部等等。 4) ...
-
Config.php在另一个目录中 Config.php was in a different directory
-
如果您想要一个不确定的进度条,请查看此站点: http : //ajaxload.info/ 。 不需要jQuery。 或者,如果你想要一个确定的,jQuery的UI库中有一个: http : //jqueryui.com/demos/progressbar/ If you want an indeterminate progress bar, check out this site: http://ajaxload.info/. No jQuery required. Or, if you want a ...
-
ASP.NET的构建方式,你不应该真的需要这样做。 代码是编译好的,所以只需引用相关的程序集或命名空间即可访问所有的类和函数,而不必包含单独的代码文件。 您可能正在寻找用户控件,它允许您创建带有相应代码的标记片段,然后在页面中引用它们。 The way ASP.NET is structured, you shouldn't really need to do this. Code is compiled, so all of your classes and functions should be acc ...
-
mysql查询使用索引进行优化的数据检索。 如果你的数据大部分时间都是静态的,而不是用户特定的,那么使用require_once就可以了。 如果您打算扩展应用程序,则必须优化数据库。 请记住,每次用户请求资源时,require_once都必须访问磁盘。 mysql queries use indexing for optmized retrieval of data. if your data will be static most of the time, not user specific, then ...
-
这很可能是由UTF-8 BOM(字节顺序标记)引起的 。 在某些HEX查看器/编辑器中打开任何文件,然后检查该文件中的前3个字节。 Windows-1250编码中的UTF-8 BOM如下所示:  。 或者在ISO-8859-1中。 这是十六进制的EF BB BF 。 只需将文件保存为UTF-8, 无需BOM 。 例如, Notepad ++编辑器在“ Format菜单下有两个选项: 转换为UTF-8(无BOM) 转换为UTF-8 This is most probably caused by t ...
-
如果不加载每个页面上的每个文件,代码在技术上运行得更快,但如果配置“OpCache”,它将在很大程度上消失,它将所有已编译的类定义加载到共享内存中。 在某些时候,您最终可能会得到一个页面,该页面需要加载90%的代码来完成其工作。 (这也与你关于缩小的问题有关 - PHP是在服务器上编译的,因此缩小对任何人都没有帮助。) 自动加载的另一个优点是维护 - 当您定义一个新类时,您不必将它添加到某些包含的主列表中,确保它在其父类之后但在其子类之前加载等。相反,你将类定义放在一个有意义的文件和目录中(非常适合人类找到 ...
-
我假设,你的include路径中不需要另一个'Testproj',所以它应该是..\PHPClasses 但是,我不建议通过调用set_include_path覆盖包含路径,因为在您的示例中,您从路径中排除标准库。 我只想使用require "../PHPClasses/MainClass.php"; 没有set_include_path(...) I assume, you do not need another 'Testproj' in your include path so it should b ...
-
这是编码问题,您需要使用“没有BOM的UTF-8”保存文件。 看看PHP包含会导致页面顶部的空白区域 It's encoding problem, you need to save your file with "UTF-8 without BOM". Look at PHP include causes white space at the top of the page