如何在Eclipse中将证书添加到SonarLint [英] How to add certificates to SonarLint in Eclipse

查看:143
本文介绍了如何在Eclipse中将证书添加到SonarLint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

连接我的SonarQube服务器需要证书.我已经安装了SonarLint插件,但是它没有任何选择来添加证书来连接SonarQube服务器.它只有URL,用户名和密码选项.有什么方法可以设置证书?

A certificate is required to connect my SonarQube server. I have installed the SonarLint plugin, but it does not have any option to add certificates to connect my SonarQube server. It has only URL, username , password options. Is there any way to set certificates ?

推荐答案

SonarLint不允许配置证书,但是您可以将证书添加到JRE或JDK.

SonarLint does not permit the configuration of certificates, but you can add certificate to JRE or JDK.

https://docs.oracle.com/javase/tutorial/security/toolsign/rstep2.html

Oracle文档中的复制文本:

Copied text from Oracle documentation:

在授予签名代码读取特定文件的权限之前,您需要将Susan的证书作为密钥库中的受信任证书导入.

Before you can grant the signed code permission to read a specified file, you need to import Susan's certificate as a trusted certificate in your keystore.

假设您是从苏珊那里收到的

Suppose that you have received from Susan

  • 已签名的JAR文件sCount.jar(其中包含Count.class文件)和
  • 文件Example.cer,其中包含与用于签名JAR文件的私钥相对应的公钥的公钥证书.
  • the signed JAR file sCount.jar, which contains the Count.class file, and
  • the file Example.cer, which contains the public key certificate for the public key corresponding to the private key used to sign the JAR file.

即使您创建了这些文件,并且实际上并未将它们传输到任何地方,您也可以模拟创建者和发送者Susan之外的其他人.假装你现在是雷.充当Ray,您将创建一个名为exampleraystore的密钥库,并将其用于将证书导入别名为susan的条目中.

Even though you created these files and they haven't actually been transported anywhere, you can simulate being someone other than the creater and sender, Susan. Pretend that you are now Ray. Acting as Ray, you will create a keystore named exampleraystore and will use it to import the certificate into an entry with an alias of susan.

每当您使用keytool命令指定尚不存在的密钥库时,都会创建一个密钥库.因此,我们可以创建exampleraystore并通过单个keytool命令导入证书.在命令窗口中执行以下操作.

A keystore is created whenever you use a keytool command specifying a keystore that doesn't yet exist. Thus we can create the exampleraystore and import the certificate via a single keytool command. Do the following in your command window.

  1. 转到包含公钥证书文件Example.cer的目录. (实际上,您应该已经在那儿了,因为本课程假定您始终在一个目录中.)
  2. 在一行上键入以下命令:
  1. Go to the directory containing the public key certificate file Example.cer. (You should actually already be there, since this lesson assumes that you stay in a single directory throughout.)
  2. Type the following command on one line:
keytool -import -alias susan -file Example.cer -keystore exampleraystore

由于密钥库尚不存在,因此将创建密钥库,并提示您输入密钥库密码;输入您想要的任何密码.

Since the keystore doesn't yet exist, it will be created, and you will be prompted for a keystore password; type whatever password you want.

keytool命令将打印出证书信息,并要求您进行验证,例如,将显示的证书指纹与从另一(可信)信息源获得的证书指纹进行比较. (每个指纹都是一个相对较短的数字,可以唯一且可靠地标识证书.)例如,在现实世界中,您可能会打电话给Susan,问她应该是什么指纹.她可以通过执行命令获取创建的Example.cer文件的指纹

The keytool command will print out the certificate information and ask you to verify it, for example, by comparing the displayed certificate fingerprints with those obtained from another (trusted) source of information. (Each fingerprint is a relatively short number that uniquely and reliably identifies the certificate.) For example, in the real world you might call up Susan and ask her what the fingerprints should be. She can get the fingerprints of the Example.cer file she created by executing the command

keytool -printcert -file Example.cer

如果她看到的指纹与keytool向您报告的指纹相同,则说明该证书在传输过程中没有被修改.在这种情况下,您让keytool继续在密钥库中放置受信任的证书条目.该条目包含来自文件Example.cer的公共密钥证书数据,并被分配了别名susan.

If the fingerprints she sees are the same as the ones reported to you by keytool, the certificate has not been modified in transit. In that case you let keytool proceed with placing a trusted certificate entry in the keystore. The entry contains the public key certificate data from the file Example.cer and is assigned the alias susan.

这篇关于如何在Eclipse中将证书添加到SonarLint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆