pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <i id='n50Ju'><tr id='n50Ju'><dt id='n50Ju'><q id='n50Ju'><span id='n50Ju'><b id='n50Ju'><form id='n50Ju'><ins id='n50Ju'></ins><ul id='n50Ju'></ul><sub id='n50Ju'></sub></form><legend id='n50Ju'></legend><bdo id='n50Ju'><pre id='n50Ju'><center id='n50Ju'></center></pre></bdo></b><th id='n50Ju'></th></span></q></dt></tr></i><div class="oo36wwu" id='n50Ju'><tfoot id='n50Ju'></tfoot><dl id='n50Ju'><fieldset id='n50Ju'></fieldset></dl></div>
      <bdo id='n50Ju'></bdo><ul id='n50Ju'></ul>
    1. <legend id='n50Ju'><style id='n50Ju'><dir id='n50Ju'><q id='n50Ju'></q></dir></style></legend>

      <tfoot id='n50Ju'></tfoot>

        <small id='n50Ju'></small><noframes id='n50Ju'>

      1. 使用證書(shū)創(chuàng)建 PHP SOAP 請(qǐng)求

        Creating a PHP SOAP request with a certificate(使用證書(shū)創(chuàng)建 PHP SOAP 請(qǐng)求)
        <tfoot id='6ITYa'></tfoot>

            <tbody id='6ITYa'></tbody>

            <legend id='6ITYa'><style id='6ITYa'><dir id='6ITYa'><q id='6ITYa'></q></dir></style></legend>
              <i id='6ITYa'><tr id='6ITYa'><dt id='6ITYa'><q id='6ITYa'><span id='6ITYa'><b id='6ITYa'><form id='6ITYa'><ins id='6ITYa'></ins><ul id='6ITYa'></ul><sub id='6ITYa'></sub></form><legend id='6ITYa'></legend><bdo id='6ITYa'><pre id='6ITYa'><center id='6ITYa'></center></pre></bdo></b><th id='6ITYa'></th></span></q></dt></tr></i><div class="36u3733" id='6ITYa'><tfoot id='6ITYa'></tfoot><dl id='6ITYa'><fieldset id='6ITYa'></fieldset></dl></div>

              <small id='6ITYa'></small><noframes id='6ITYa'>

                <bdo id='6ITYa'></bdo><ul id='6ITYa'></ul>

                1. 本文介紹了使用證書(shū)創(chuàng)建 PHP SOAP 請(qǐng)求的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我正在嘗試創(chuàng)建一個(gè)到具有自簽名證書(shū)的 .NET Web 服務(wù)的 PHP SOAP 連接,以便鎖定該服務(wù)以通過(guò) HTTPS 進(jìn)行通信.我繼續(xù)遇到錯(cuò)誤,我不確定它是否與我創(chuàng)建證書(shū)的方式、我的 Apache/PHP 設(shè)置、我嘗試建立 SOAP 請(qǐng)求的方式或其他方式有關(guān).如果有人有任何指示,他們將不勝感激.提前致謝.

                  I am attempting to create a PHP SOAP connection to a .NET Web Service that has a self-signed certificate in order to lock down the service for communication over HTTPS. I continue to get error's and I'm not sure if it has something to do with the way I create the certificate, my Apache/PHP setup, the way I attempt to establish the SOAP request or something else. If anyone has any pointers they will be greatly appreciated. Thanks in advance.

                  這就是我創(chuàng)建證書(shū)的方式.

                  This is how I am creating the certificate.

                  1. 創(chuàng)建受信任的根私鑰:

                  1. Create the trusted root private key:

                  genrsa -out ca_authority_prv.pem 2048

                  genrsa -out ca_authority_prv.pem 2048

                2. 創(chuàng)建受信任的根授權(quán)證書(shū):

                3. Create the trusted root authority cert:

                  req -new -key ca_authority_prv.pem -x509 -out ca_authority_cert.pem

                  req -new -key ca_authority_prv.pem -x509 -out ca_authority_cert.pem

                4. 使證書(shū)頒發(fā)機(jī)構(gòu)受信任:

                5. Make the cert authority trusted:

                  x509 -in ca_authority_cert.pem -out ca_authority_trust.pem -trustout

                  x509 -in ca_authority_cert.pem -out ca_authority_trust.pem -trustout

                6. 退出 OpenSSL 并創(chuàng)建一個(gè)串行文件:

                7. Exit OpenSSL and create a serial file:

                  echo 1000 > ca_authority.srl

                  echo 1000 > ca_authority.srl

                8. 創(chuàng)建客戶端私鑰:

                9. Create the client private key:

                  genrsa -out Client_prv.pem 2048

                  genrsa -out Client_prv.pem 2048

                10. 創(chuàng)建客戶端請(qǐng)求:

                11. Create the client request:

                  req -new -key Client_prv.pem -out Client_req.pem

                  req -new -key Client_prv.pem -out Client_req.pem

                12. 使用 CA 簽署客戶端請(qǐng)求:

                13. Sign the client request with the CA:

                  x509 -req -CA ca_authority_trust.pem -CAserial ca_authority.srl -CAkey ca_authority_prv.pem -in Client_req.pem -out Client_cert.pem

                  x509 -req -CA ca_authority_trust.pem -CAserial ca_authority.srl -CAkey ca_authority_prv.pem -in Client_req.pem -out Client_cert.pem

                14. 為客戶端證書(shū)制作 pfx

                15. Make the pfx for the client cert

                  pkcs12 -export -in Client_cert.pem -inkey Client_prv.pem -out Client_cert.pfx

                  pkcs12 -export -in Client_cert.pem -inkey Client_prv.pem -out Client_cert.pfx

                16. IIS 設(shè)置

                  創(chuàng)建此證書(shū)后,我對(duì)服務(wù)器證書(shū)執(zhí)行相同的步驟,并且:

                  IIS Setup

                  Once this certificate is created I follow the same steps for a server certificate and:

                  1. 將受信任的根 CA 添加到機(jī)器受信任的根存儲(chǔ)

                  1. Add the trusted root CA to the Machine Trusted Root Store

                  將服務(wù)器證書(shū)添加到機(jī)器存儲(chǔ)區(qū)

                  Add the server certificate to the machine store

                  設(shè)置 IIS 以使用服務(wù)器證書(shū)并需要客戶端證書(shū)

                  Setup IIS to use the server certificate and require client certificates

                  PHP SOAP 請(qǐng)求

                  這是我用來(lái)建立 PHP SOAP 請(qǐng)求的代碼(以下是錯(cuò)誤):

                  PHP SOAP Request

                  This is the code I am using to establish the PHP SOAP request (below is the error):

                  $wsdl = "https://localhost/MyService/MyService.asmx";
                  $local_cert = "C:\Certsclient_cert.pem";
                  $passphrase = "openSaysMe";
                  
                      $soapClient = new SoapClient($wsdl, array('local_cert'=>  $local_cert,'passphrase'=>$passphrase));
                      $theResponse = $soapClient->test();
                  

                  錯(cuò)誤

                  Warning: SoapClient::SoapClient() [soapclient.soapclient]: Unable to set private key file `C:Certsclient_cert.pem' in C:Program FilesApache GroupApache2htdocssoapWithAuth.php on line 53
                  
                  Warning: SoapClient::SoapClient() [soapclient.soapclient]: failed to create an SSL handle in C:Program FilesApache GroupApache2htdocssoapWithAuth.php on line 53
                  
                  Warning: SoapClient::SoapClient() [soapclient.soapclient]: Failed to enable crypto in C:Program FilesApache GroupApache2htdocssoapWithAuth.php on line 53
                  
                  Warning: SoapClient::SoapClient(https://localhost/MyService/MyService.asmx) [soapclient.soapclient]: failed to open stream: operation failed in C:Program FilesApache GroupApache2htdocssoapWithAuth.php on line 53
                  
                  Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://localhost/MyService/MyService.asmx" in C:Program FilesApache GroupApache2htdocssoapWithAuth.php on line 53
                  Error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://localhost/MyService/MyService.asmx'
                  

                  錯(cuò)誤日志

                  PHP Warning:  SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: failed to create an SSL handle in C:\Program Files\Apache Group\Apache2\htdocs\soapWithAuth.php on line 54
                  

                  推薦答案

                  我設(shè)法讓它工作了,但我想知道一些奇怪的地方.特別是需要將客戶端證書(shū)和私鑰組合到一個(gè)文件中以與 Soap 請(qǐng)求以及證書(shū)密碼短語(yǔ)一起發(fā)送,這破壞了請(qǐng)求,盡管 PHP Soap 文檔明確將其作為一個(gè)選項(xiàng)包含在內(nèi).如果有人對(duì)如何改進(jìn)這一點(diǎn)有意見(jiàn),我很樂(lè)意聽(tīng)到.

                  I managed to get this working but there are some oddities that I wonder about. Specifically the need to combine the client certificate and private key into a single file to send along with the Soap Request as well as the certificate pass-phrase was breaking the request although the PHP Soap documentation explicitly includes it as an option. If anyone has input on how to improve this I would love to hear it.

                  1) 創(chuàng)建 OpenSsl 客戶端和服務(wù)器證書(shū),并使用證書(shū)頒發(fā)機(jī)構(gòu)對(duì)其進(jìn)行簽名.創(chuàng)建證書(shū)時(shí)不要為它們分配密碼,只需在此時(shí)按下 Enter 按鈕即可.

                  1) Create the OpenSsl client and server certificates and sign them with the certificate authority. When creating the certificate do not assign a passphrase to them, just hit the enter button at that point.

                  2) 將服務(wù)器證書(shū)頒發(fā)機(jī)構(gòu)文件導(dǎo)入受信任根下的 Machine 證書(shū)庫(kù).您可以通過(guò)在命令提示符下使用 MMC 命令然后添加證書(shū)管理單元來(lái)實(shí)現(xiàn)這一點(diǎn).

                  2) Import the server certificate authority file into the Machine certificate store under the trusted root. You can get to this by using the MMC command at the command prompt and then adding the Certificates snap in.

                  3) 將服務(wù)器證書(shū)導(dǎo)入到機(jī)器存儲(chǔ)個(gè)人證書(shū)存儲(chǔ)中

                  3) Import the Server certificate into the Machine store Personal certificate store

                  4) 在本地賬戶個(gè)人存儲(chǔ)中導(dǎo)入客戶端證書(shū).您可以通過(guò)在命令提示符下鍵入 certmgr.msc 來(lái)執(zhí)行此操作.

                  4) Import the client certificate in the local account Personal store. You can do this by typing certmgr.msc at the command prompt.

                  5) 確保運(yùn)行帶有 SSL 版本的 PHP 的 Apache.如果您已經(jīng)安裝了非 php 版本的 PHP,則可以按照以下步驟將 Apache 服務(wù)器配置為使用 SSL 運(yùn)行.

                  5) Make sure to have Apache with a SSL version of PHP running. If you already had a non-php version of PHP installed you can follow these steps to configure your Apache server to run using SSL.

                  內(nèi)部httpd.conff

                  a) Remove the comment ‘#’ at line : LoadModule ssl_module modules/mod_ssl.so
                  
                  b) Remove the comment ‘#’ at the line inside `<IfModule ssl_module>`:  Include /extra/httpd-ssl.conf
                  
                     and move this line after the block `<IfModule ssl_module>…. </IfModule>`  
                  

                  php.ini

                  c) Remove the comment ‘;’ at the line which says: extension=php_openssl.dll
                  

                  6) 使用以下步驟配置 IIS 以使用證書(shū)和 SSL:

                  6) Configure IIS to use a certificate and SSL using the following steps:

                  a) Right click the 'Default Website' node choose 'Properties'
                  
                  b) 'Directory Security' tab 'Server Certificate' button. Follow the wizard to select the certificate you imported into the store then complete the wizard and return to the 'Directory Security' tab.
                  
                  c) Under 'Secure Communications' select the 'Edit' button. 
                  
                  d) Check the 'Require Secure Channel (SSL) checkbox.
                  

                  7) 創(chuàng)建 PHP SOAP 請(qǐng)求(test() 方法應(yīng)該是您的 Web 服務(wù)中的有效方法):

                  7) Creating the PHP SOAP request (the test() method should be a valid method in your Web service):

                  $wsdl = "https://localhost/MyService/myservices.asmx?wsdl";
                  $local_cert = "C:\SoapCertsClientKeyAndCer.pem";
                  
                  $soapClient = new SoapClient($wsdl, array('local_cert' => $local_cert));
                  
                  $theResponse = $soapClient->test();
                  

                  8) 將此文件放入您的 Apache 目錄中.默認(rèn):'C:Program FilesApache GroupApache2htdocs'

                  8) Place this file into your Apache directory. By Default: 'C:Program FilesApache GroupApache2htdocs'

                  9) 您將需要訪問(wèn)客戶端證書(shū).在您生成客戶端和服務(wù)器證書(shū)的步驟中,您還生成了私鑰文件.打開(kāi) client_prv.pem(客戶端私鑰文件)并使用文本編輯器將內(nèi)容復(fù)制到新文檔中.使用像 Textpad 這樣的東西可能更安全,它希望不會(huì)添加一堆特殊字符,證書(shū)解析器非常挑剔.在私鑰部分之后立即放置客戶端證書(shū)(client_cer.pem)的內(nèi)容,以便生成的文件是客戶端私鑰和客戶端的未轉(zhuǎn)義副本

                  9) You will need access to the client certificate. In the steps you took to produce the client and server certificates you also produced the private key files. Open the client_prv.pem (the client private key file) and copy the contents into a new document with a text editor. It is probably safer to use something like Textpad that will hopefully not add a bunch of special characters, certificate parsers are very picky. Immediately after the private key part place the contents of the client certificate (client_cer.pem) so that the resulting file is an un-escaped copy of the client private key and client

                  證書(shū).將生成的文件保存到您可以從 php 文件訪問(wèn)的目錄中.在上面的例子中,結(jié)果文件是

                  certificate. Save the resulting file to a directory you can get to from the php file. In the example above the resulting file is the

                  'C:SoapCertsClientKeyAndCer.pem' 文件.

                  'C:SoapCertsClientKeyAndCer.pem' file.

                  9) 導(dǎo)航到 localhost/nameOfYourFile.php.您應(yīng)該會(huì)看到與服務(wù)的成功連接,其響應(yīng)與您的

                  9) Navigate to localhost/nameOfYourFile.php. You should see a successful connection to the service with a response matching the expected results from your

                  Web 服務(wù)方法.

                  這篇關(guān)于使用證書(shū)創(chuàng)建 PHP SOAP 請(qǐng)求的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  enable SOAP on PHP(在 PHP 上啟用 SOAP)
                  Get received XML from PHP SOAP Server(從 PHP SOAP 服務(wù)器獲取接收到的 XML)
                  not a valid AllXsd value(不是有效的 AllXsd 值)
                  PHP SoapClient: SoapFault exception Could not connect to host(PHP SoapClient:SoapFault 異常無(wú)法連接到主機(jī))
                  Implementation of P_SHA1 algorithm in PHP(PHP中P_SHA1算法的實(shí)現(xiàn))
                  Sending a byte array from PHP to WCF(將字節(jié)數(shù)組從 PHP 發(fā)送到 WCF)
                17. <tfoot id='3rJU4'></tfoot>
                  <i id='3rJU4'><tr id='3rJU4'><dt id='3rJU4'><q id='3rJU4'><span id='3rJU4'><b id='3rJU4'><form id='3rJU4'><ins id='3rJU4'></ins><ul id='3rJU4'></ul><sub id='3rJU4'></sub></form><legend id='3rJU4'></legend><bdo id='3rJU4'><pre id='3rJU4'><center id='3rJU4'></center></pre></bdo></b><th id='3rJU4'></th></span></q></dt></tr></i><div class="kcypz7c" id='3rJU4'><tfoot id='3rJU4'></tfoot><dl id='3rJU4'><fieldset id='3rJU4'></fieldset></dl></div>

                      <tbody id='3rJU4'></tbody>

                    <small id='3rJU4'></small><noframes id='3rJU4'>

                          • <bdo id='3rJU4'></bdo><ul id='3rJU4'></ul>

                            <legend id='3rJU4'><style id='3rJU4'><dir id='3rJU4'><q id='3rJU4'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 北京律师咨询_知名专业北京律师事务所_免费法律咨询 | 桁架机器人_桁架机械手_上下料机械手_数控车床机械手-苏州清智科技装备制造有限公司 | 单螺旋速冻机-双螺旋-流态化-隧道式-食品速冻机厂家-广州冰泉制冷 | 兰州牛肉面加盟,兰州牛肉拉面加盟-京穆兰牛肉面 | 口信网(kousing.com) - 行业资讯_行业展会_行业培训_行业资料 | 行吊_电动单梁起重机_双梁起重机_合肥起重机_厂家_合肥市神雕起重机械有限公司 | 东莞市天进机械有限公司-钉箱机-粘箱机-糊箱机-打钉机认准东莞天进机械-厂家直供更放心! | 菏泽知彼网络科技有限公司| 上海律师事务所_上海刑事律师免费咨询平台-煊宏律师事务所 | 昆山PCB加工_SMT贴片_PCB抄板_线路板焊接加工-昆山腾宸电子科技有限公司 | Brotu | 关注AI,Web3.0,VR/AR,GPT,元宇宙区块链数字产业 | 杭州成人高考_浙江省成人高考网上报名 | 加气混凝土砌块设备,轻质砖设备,蒸养砖设备,新型墙体设备-河南省杜甫机械制造有限公司 | 喷播机厂家_二手喷播机租赁_水泥浆洒布机-河南青山绿水机电设备有限公司 | 佛山市钱丰金属不锈钢蜂窝板定制厂家|不锈钢装饰线条|不锈钢屏风| 电梯装饰板|不锈钢蜂窝板不锈钢工艺板材厂家佛山市钱丰金属制品有限公司 | 卓能JOINTLEAN端子连接器厂家-专业提供PCB接线端子|轨道式端子|重载连接器|欧式连接器等电气连接产品和服务 | 原子吸收设备-国产分光光度计-光谱分光光度计-上海光谱仪器有限公司 | 云南丰泰挖掘机修理厂-挖掘机维修,翻新,再制造的大型企业-云南丰泰工程机械维修有限公司 | 不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰]-不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰] | 山东限矩型液力偶合器_液力耦合器易熔塞厂家-淄博市汇川源机械厂 | 热处理炉-退火炉-回火炉设备厂家-丹阳市电炉厂有限公司 | 北京网站建设-企业网站建设-建站公司-做网站-北京良言多米网络公司 | 广州监控安装公司_远程监控_安防弱电工程_无线wifi覆盖_泉威安防科技 | 高低温试验房-深圳高低温湿热箱-小型高低温冲击试验箱-爱佩试验设备 | 期货软件-专业期货分析软件下载-云智赢 | 东莞ERP软件_广州云ERP_中山ERP_台湾工厂erp系统-广东顺景软件科技有限公司 | 阀门智能定位器_电液动执行器_气动执行机构-赫尔法流体技术(北京)有限公司 | 机械加工_绞车配件_立式离心机_减速机-洛阳三永机械厂 | 气弹簧定制-气动杆-可控气弹簧-不锈钢阻尼器-工业气弹簧-可调节气弹簧厂家-常州巨腾气弹簧供应商 | 天津试验仪器-电液伺服万能材料试验机,恒温恒湿标准养护箱,水泥恒应力压力试验机-天津鑫高伟业科技有限公司 | 品牌设计_VI设计_电影海报设计_包装设计_LOGO设计-Bacross新越品牌顾问 | 凝胶成像系统(wb成像系统)百科-上海嘉鹏 | 水压力传感器_数字压力传感器|佛山一众传感仪器有限公司|首页 | 北京开业庆典策划-年会活动策划公司-舞龙舞狮团大鼓表演-北京盛乾龙狮鼓乐礼仪庆典策划公司 | 电镀标牌_电铸标牌_金属标贴_不锈钢标牌厂家_深圳市宝利丰精密科技有限公司 | 模温机-油温机-电加热导热油炉-工业冷水机「欧诺智能」 | 华禹护栏|锌钢护栏_阳台护栏_护栏厂家-华禹专注阳台护栏、楼梯栏杆、百叶窗、空调架、基坑护栏、道路护栏等锌钢护栏产品的生产销售。 | 伊卡洛斯软装首页-电动窗帘,别墅窗帘,定制窗帘,江浙沪1000+别墅窗帘案例 | 烽火安全网_加密软件、神盾软件官网 | 宁夏档案密集柜,智能密集柜,电动手摇密集柜-盛隆柜业宁夏档案密集柜厂家 | 高压包-点火器-高压发生器-点火变压器-江苏天网 |