小编Phi*_*hil的帖子

Firefox 33.0无法打开特定的本地应用程序:错误代码:sec_error_invalid_key

Firefox今早升级到33.0版.从那时起,我无法通过HTTPS加载特定的本地应用程序 - 请注意它使用自签名证书.它显示以下错误消息:

The key does not support the requested operation. (Error code: sec_error_invalid_key)

我在Firebug中看不到任何东西.我以安全模式重启Firefox,以确保没有加载项是问题.我还清理了我的缓存和cookie.使用Chrome可以打开相同的应用程序,Firefox可以打开其他使用HTTPS并带有自签名证书的应用程序.

知道如何解决这个问题吗?

编辑: Mozilla对Firefox 33.0中的安全性进行了几项重要更改.细节可以在这里找到.

在我的特殊情况下,自签名证书被阻止,因为它被认为太弱了:

RSA 512,1000和1023位证书现在被Firefox阻止,因为它们不足以提供安全性.当前发布的大多数证书应具有2048位密钥长度.

firefox

14
推荐指数
2
解决办法
3万
查看次数

在Groovy中尾随文件

我想知道是否有一种简单的方法可以在Groovy中拖尾文件?我知道如何读取文件,但如何读取文件,然后等待添加更多行,读取,等待等等...

我有一个我确定是一个非常愚蠢的解决方案:

def lNum = 0
def num= 0
def numLines = 0
def myFile = new File("foo.txt")
def origNumLines = myFile.eachLine { num++ }
def precIndex = origNumLines

while (true) {
num = 0
lNum = 0
numLines = myFile.eachLine { num++ }

if (numLines > origNumLines) {
    myFile.eachLine({ line ->

    if (lNum > precIndex) {
            println line
        }
    lNum++
    })
}
precIndex = numLines

 Thread.sleep(5000)
}
Run Code Online (Sandbox Code Playgroud)

请注意,我对调用Unix"tail"命令并不感兴趣.除非它是唯一的解决方案.

groovy

9
推荐指数
1
解决办法
2654
查看次数

使用elemMatch对嵌套数组数据进行MongoDB查询

我有一个包含嵌套数组数据的文档.我毫无希望地尝试使用过滤数据,$elemMatch但我无法弄清楚为什么它不起作用.

{
'id' : 1,
'name' : 'test',
'modules' : [
    {
        name: 'foo',
        mandatory: false,
        group: [
            {
                name: g1
            }]
    },
    {
        name: 'bar',
        mandatory: false,
        group: [
            {
                name: g2
            }]
    }]
}
Run Code Online (Sandbox Code Playgroud)

我尝试使用此查询:

db.test.find(
{
  modules: {
            $elemMatch: {
                 name: "foo",
            }
  }
}
Run Code Online (Sandbox Code Playgroud)

但它不断返回所有模块.如果我使用mandatory: true它返回任何东西,这似乎表明它的工作原理.知道我做错了什么吗?谢谢!

mongodb

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

无法在TomcatConnectorCustomizer中为Spring Boot配置端口

我有一个Spring Boot应用程序,它将遗留Web服务公开为RESTful API.相关代码将是:

@Configuration
@PropertySource("classpath:foo.properties")
@ComponentScan("foo.bar")
@EnableAutoConfiguration
public class Application {

    @Autowired
    private Environment env;

    @Bean
    public EmbeddedServletContainerCustomizer containerCustomizer()  throws FileNotFoundException {
        final String absoluteKeystoreFile = ResourceUtils.getFile(env.getProperty("security.settings.keystore.path")).getAbsolutePath();
        System.out.println("PATH: " + absoluteKeystoreFile);

        return new EmbeddedServletContainerCustomizer() {
            @Override
            public void customize(  ConfigurableEmbeddedServletContainer factory) {
                if (factory instanceof TomcatEmbeddedServletContainerFactory) {
                    TomcatEmbeddedServletContainerFactory containerFactory = (TomcatEmbeddedServletContainerFactory) factory;
                    containerFactory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
                        @Override
                        public void customize(Connector connector) {
                            connector.setPort(Integer.parseInt(env.getProperty("server.settings.port")));
                            connector.setDomain(env.getProperty("server.settings.address"));
                            connector.setSecure(true);
                            connector.setScheme("https");
                            Http11NioProtocol proto = (Http11NioProtocol) connector.getProtocolHandler();
                            proto.setSSLEnabled(true);
                            proto.setKeystoreFile(absoluteKeystoreFile);
                            proto.setKeystorePass(env.getProperty("security.settings.keystore.pass"));
                            proto.setKeystoreType(env.getProperty("security.settings.keystore.type"));
                            proto.setKeyAlias(env.getProperty("security.settings.key.alias"));
                        }
                    });
                }
            }
        }; …
Run Code Online (Sandbox Code Playgroud)

tomcat spring-boot

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

UITabBarControllerDelegate 的 shouldSelect 方法从未被调用

我正在使用 Swift 4 和 XCode 9。我试图在我的 UITabBarController 中以编程方式控制导航。根据Apple 的文档,我需要实现该UITabBarControllerDelegate协议。但是,我实现的方法从未被调用:

import UIKit

class TabBarController: UITabBarController, UITabBarControllerDelegate {
    override func viewDidLoad() {
        super.viewDidLoad()

        tabBarController?.delegate = self
    }

    func tabBarController(_ tabBarController: UITabBarController,
            shouldSelect viewController: UIViewController) -> Bool {
        print("Should go here...")
        return true
    }
}
Run Code Online (Sandbox Code Playgroud)

知道我做错了什么吗?

uitabbarcontroller ios swift

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