加载Google网站时,JxBrowser会显示ssl错误

时间:2016-05-11 21:58:30

标签: java ssl javafx jxbrowser

大家好。我使用JxBrowser来显示网页,但在连接到Google网站时,它给了我ssl错误:

SSL Google Error

SSL YouTube Error

但它适用于维基百科这样的网站:

Wikipedia

以下是在启动时运行的代码,用于在新标签中加载google.com:

@reboot

以及在启动时调用该函数的代码:

private void createNewTab(){
    Tab tempTab = new Tab();
    tempTab.setText("New Tab");
    AnchorPane tempAnchorPane = new AnchorPane();
    Browser tempBrowser = new Browser();
    BrowserView view = new BrowserView(tempBrowser);
    view.getBrowser().loadURL("https://google.com");        

    tempAnchorPane.getChildren().add(view);
    tempAnchorPane.setTopAnchor(view, 0.0);
    tempAnchorPane.setLeftAnchor(view, 0.0);
    tempAnchorPane.setRightAnchor(view, 0.0);
    tempAnchorPane.setBottomAnchor(view, 0.0);
    browserToTabMap.put(tempBrowser, tempTab);

    tempTab.setContent(view);
    rootPane.getTabs().add(tempTab);
}

以下是JxBrowser命令行输出中的日志:

@FXML
void initialize() {
    assert rootPane != null : "fx:id=\"rootPane\" was not injected: check your FXML file 'Expedition.fxml'.";
    assert addressBar != null : "fx:id=\"addressBar\" was not injected: check your FXML file 'Expedition.fxml'.";




    BrowserView view = new BrowserView();
    root.addEventFilter(KeyEvent.KEY_TYPED, new EventHandler<KeyEvent>(){
        @Override
        public void handle(KeyEvent event) {
            if(processKeys(event)){
                System.out.println("Consuming event " + event);
                event.consume();
            }                    
        }
    });
    root.addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>(){
        @Override
        public void handle(KeyEvent event) {
            if(event.getCode() == KeyCode.ESCAPE){
                insertMode = false;
                System.out.println("Coming out of insert mode");
                rootPane.getSelectionModel().getSelectedItem().getContent().requestFocus();
                event.consume();
            }
        }            
    });

    addressBar.focusedProperty().addListener(new ChangeListener<Boolean>(){
        @Override
        public void changed(ObservableValue<? extends Boolean> arg0, Boolean oldPropertyValue, Boolean newPropertyValue)
        {
            if (newPropertyValue)
            {
                System.out.println("addressBar focused");
            }
            else
            {
                System.out.println("addressBar out of focus");
                insertMode = false;
            }
        }
    });

    createNewTab();

    Runnable temp = () -> {
        try{
            Thread.sleep(5000);
        }
        catch(InterruptedException exc){

        }
        Platform.runLater(new Runnable(){
            @Override public void run(){
                ((Stage)rootPane.getScene().getWindow()).setMaximized(true);
                rootPane.getSelectionModel().getSelectedItem().getContent().requestFocus();
            }                
        });             
    };
    Thread tempThr = new Thread(temp);
    temp.run();
    currentTab = 0;
}

1 个答案:

答案 0 :(得分:1)

JxBrowser 6.3基于Chromium 43.据我所知,Chromium 43在最新的Linux发行版(如Ubuntu 15.10)上有更新的NSS库存在一些问题。根据{{​​3}}的错误报告,少于48的Chromium版本与最新的Ubuntu安全更新存在不兼容问题,这些更新破坏了Chromium引擎中的HTTPS功能。在Chromium 48及更高版本中,该问题不可重现。

我们已根据Chromium 49准备了https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1547762的更新版本。您能否在Linux环境中尝试一下,如果有帮助请告诉我。