小编Win*_*ton的帖子

使用PHP对Windows Store IAP签名验证远程证书

我正在尝试在PHP中为Windows应用商店应用验证IAP收据.基本上,尝试将此示例代码转换为PHP http://msdn.microsoft.com/en-us/library/windows/apps/jj649137.aspx.收据看起来像这样

<Receipt Version="1.0" ReceiptDate="2012-08-30T23:08:52Z" CertificateId="b809e47cd0110a4db043b3f73e83acd917fe1336" ReceiptDeviceId="4e362949-acc3-fe3a-e71b-89893eb4f528">
    <ProductReceipt Id="6bbf4366-6fb2-8be8-7947-92fd5f683530" ProductId="Product1" PurchaseDate="2012-08-30T23:08:52Z" ExpirationDate="2012-09-02T23:08:49Z" ProductType="Durable" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" />
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
            <SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
            <Reference URI="">
                <Transforms>
                    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                </Transforms>
                <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                <DigestValue>Uvi8jkTYd3HtpMmAMpOm94fLeqmcQ2KCrV1XmSuY1xI=</DigestValue>
            </Reference>
        </SignedInfo>
        <SignatureValue>TT5fDET1X9nBk9/yKEJAjVASKjall3gw8u9N5Uizx4/Le9RtJtv+E9XSMjrOXK/TDicidIPLBjTbcZylYZdGPkMvAIc3/1mdLMZYJc+EXG9IsE9L74LmJ0OqGH5WjGK/UexAXxVBWDtBbDI2JLOaBevYsyy+4hLOcTXDSUA4tXwPa2Bi+BRoUTdYE2mFW7ytOJNEs3jTiHrCK6JRvTyU9lGkNDMNx9loIr+mRks+BSf70KxPtE9XCpCvXyWa/Q1JaIyZI7llCH45Dn4SKFn6L/JBw8G8xSTrZ3sBYBKOnUDbSCfc8ucQX97EyivSPURvTyImmjpsXDm2LBaEgAMADg==</SignatureValue>
    </Signature>
</Receipt>
Run Code Online (Sandbox Code Playgroud)

我已经为这样的服务器检索了证书

function getCertificate($certID)
{
    $url  = 'https://lic.apps.microsoft.com/licensing/certificateserver/?cid=' . $certID;
    $path = '/mypath/certs/' . $certID;

    if(!file_exists($path)) {
        $fp = fopen($path, 'w');

        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_FILE, $fp);

        $data = curl_exec($ch);

        curl_close($ch);
        fclose($fp);
    }
    $cert = file_get_contents($path);
    //var_dump(openssl_x509_parse($cert));

    return openssl_x509_read($cert);
} …
Run Code Online (Sandbox Code Playgroud)

php windows openssl

7
推荐指数
1
解决办法
1432
查看次数

移动到SSL后页面加载后丢失会话

更新:

该网站现在可以在所有浏览器上运行但是现在Chrome.我觉得这很奇怪 - 自从服务器切换到拥有SSL以来,这一切都已经出现了.

作为建议,我已将其置于应用程序中:

ini_set('session.use_trans_sid', true);
ini_set('session.use_cookies', true);
ini_set('session.use_only_cookies', true);

$https = false;

if(isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] != 'off') {
    $https = true;
}

$dirname = rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/';

session_name('money');
session_set_cookie_params(0, '/', $_SERVER['HTTP'], $https, true);
session_start();
Run Code Online (Sandbox Code Playgroud)

但是我仍然无法设置会话 - 应用程序基于MVC,因此根据URL中加载的页面需要控制器.

Sessions是否存在通过必需/包含文件传递的问题?

php apache ssl

2
推荐指数
1
解决办法
720
查看次数

找不到对象!在此服务器上找不到请求的URL。本地主机

大家好。我有一个典型的设置A,M,P,我只是在本地服务器上进行一些测试以设置网页。我对php和动态网站有些陌生,所以我有点困惑。所以我在这里陷入僵局。每当我尝试在浏览器中查看页面并单击链接时,都会出现此错误:

找不到对象!在此服务器上找不到请求的URL。推荐页面上的链接似乎有误或已过时。请将该错误告知该页面的作者。如果您认为这是服务器错误,请与网站管理员联系。错误404本地主机Apache / 2.4.3(Win32)OpenSSL / 1.0.1c PHP / 5.4.7

my url looks like this: http://localhost/test/content/home
Run Code Online (Sandbox Code Playgroud)

这是我的index.php页面和nav.php页面的代码

第一个index.php

<?php
include('Config/setup.php');
?>
<?php
if(isset($_GET['page']) && $_GET['page'] == !'') {
    $pg = $_GET['page'];
} else {
    $pg = 'home';
}
#var_dump($pg);
#exit;
?>

<!DOCTYPE HTML>
<html>
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">

    <title>FTS</title>
    <link href="css/Styles.css" rel="stylesheet" type="text/css">
</head>

<body>
<div class="header temp_Block">
    <?php include('templates/header.php');?>
</div>

<div class="main_nav temp_Block">
    <?php include('templates/main_nav.php');?>
</div>

<div class="main_Content temp_Block">
    <?php include('Content/'.$pg.'.php');?>
</div>

<div class="footer temp_Block">
    <?php include('templates/footer.php');?>
</div>
</body> …
Run Code Online (Sandbox Code Playgroud)

php localhost http-status-code-404

0
推荐指数
1
解决办法
8万
查看次数

标签 统计

php ×3

apache ×1

http-status-code-404 ×1

localhost ×1

openssl ×1

ssl ×1

windows ×1