java JWebBrowser 内嵌浏览器访问支付宝页面问题

最近在做一个小应用需要用到内嵌游览器访问支付宝页面,遇到一个问题怎么都无法解决,请高手帮忙看看!

访问页面时怎么都会提示一个“安全警报”,内容是“该安全证书已到期或还未生效”,如图:

 

点击查看证书如下:

我试过把这个报错的证书删除掉,但是依然会提示这个证书问题。系统时间和当前时间相同,也做过windows时间同步,问题还是没有解决。最后贴上内嵌浏览器的代码:

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import chrriis.common.UIUtils;
import chrriis.dj.nativeswing.swtimpl.NativeInterface;
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser;

public class Test11111 extends JPanel
{
    private JPanel webBrowserPanel;
    private JWebBrowser webBrowser;

    public Test11111(String url)
    {
        super(new BorderLayout());
        webBrowserPanel = new JPanel(new BorderLayout());
        webBrowser = new JWebBrowser();
        webBrowser.navigate(url);
        webBrowser.setButtonBarVisible(false);
        webBrowser.setMenuBarVisible(false);
        webBrowser.setBarsVisible(false);
        webBrowser.setStatusBarVisible(false);
        webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
        add(webBrowserPanel, BorderLayout.CENTER);
    }

    public static void main(String[] args)
    {
        final String url = "https://auth.alipay.com/login/index.htm";
        final String title = "测试";
        UIUtils.setPreferredLookAndFeel();
        NativeInterface.open();

        SwingUtilities.invokeLater(new Runnable()
        {
            public void run()
            {
                JFrame frame = new JFrame(title);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.getContentPane().add(new Test11111(url), BorderLayout.CENTER);
                frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
                frame.setLocationByPlatform(true);
                //frame.setUndecorated(true);
                frame.setVisible(true);
            }
        });
        NativeInterface.runEventPump();
    }
}

请遇到过这个问题的高手帮忙看看是什么问题,谢谢!

猜你喜欢

转载自wwwoodhyx.iteye.com/blog/2320111