概述:我有一个运行PHP 7的应用服务器,使用MongoDB PHP用户区库连接到运行MongoDB 3.6.x的单独数据库服务器.我有防火墙规则阻止从本地和私有接口以外的所有来源访问MongoDB服务器(即禁止公共IP访问).
通过PHP连接看起来像这样:
$context_information = array(
"ssl" => array(
"allow_self_signed" => false,
"verify_peer" => true,
"verify_peer_name" => true,
"verify_expiry" => true,
"cafile" => "/path/to/ca_bundle"
));
$context = stream_context_create($context_information);
$connection = new MongoDB\Client(
$host,
array('ssl'=>true),
array('context'=> $context)
);
Run Code Online (Sandbox Code Playgroud)
我的MongoDB配置看起来像这样:
net:
port: 27017
bindIp: 127.0.0.1,10.138.196.241
ssl:
mode: requireSSL
PEMKeyFile: /path/to/my_ca_signed_cert
CAFile: /path/to/my_ca_bundle
Run Code Online (Sandbox Code Playgroud)
my_ca_signed_cert是.pem使用我的openssl生成的RSA私钥生成的.crt文件,以及CA提供的文件,以MongoDB手册中描述的方式生成,例如cat mongodb.key mongodb.crt > mongodb.pem.my_ca_bundle是.ca-bundle由CA提供给我的.
此外,ca_bundlePHP上下文中描述的.ca-bundle文件与MongoDB配置中的文件相同.
问题:我继续收到以下错误:
[23-Jul-2018 16:33:33 America/Los_Angeles] PHP致命错误:未捕获MongoDB\Driver\Exception\ConnectionTimeoutException:找不到合适的服务器( …
我注意到,当子组件中存在所需的输入时,尽管没有发生用户操作,但没有有效默认值的输入会在渲染时自动突出显示为不正确。预期的行为是在发生无效提交尝试之前不会突出显示这些表单输入。
如果这些必需的输入存在于根 Vue 实例中,则此问题不存在。
为什么会发生这种情况?这是一个错误,还是有我设法忽略的记录解决方案(除了第三方输入组件)?
下面是一个演示问题的最小示例。
Vue.component('my-form-component', {
template: `
<form>
<input type="radio" v-model="input_val" name="test" value="0" required/> 0
<br/>
<input type="radio" v-model="input_val" name="test" value="0" required/> 1
</form>
`,
data: function() {
return {
input_val: ''
};
}
});
new Vue({
el: '#app'
});Run Code Online (Sandbox Code Playgroud)
<script src="https://unpkg.com/vue@2.5.13/dist/vue.js"></script>
<div id="app">
<my-form-component></my-form-component>
</div>Run Code Online (Sandbox Code Playgroud)
此外,这个问题是在使用 Firefox 时观察到的,并且存在于以前版本的浏览器中。