首页 \ 问答 \ C / C ++对CXF服务器的SSL请求(C/C++ SSL Request to CXF Server)

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
更新时间:2024-02-15 11:02

最满意答案

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

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)