Commit ac96734b authored by Roman Shevchenko's avatar Roman Shevchenko Committed by intellij-monorepo-bot
Browse files

[platform] retires "use secure connection" update option; HTTPS all the way down (IDEA-190776)

GitOrigin-RevId: 4a910d94c4982e0d1688222edae7c68f12a1d307
parent ee2300b1
Branches unavailable Tags unavailable
No related merge requests found
Showing with 56 additions and 168 deletions
+56 -168
......@@ -16,9 +16,10 @@
<editor background-url="/idea_logo_welcome.png"/>
<plugins url="http://plugins.jetbrains.com/" builtin-url="__BUILTIN_PLUGINS_URL__"/>
<update-urls check="http://www.jetbrains.com/updates/updates.xml"
patches="http://download.jetbrains.com/idea/"/>
<plugins url="https://plugins.jetbrains.com/"
builtin-url="__BUILTIN_PLUGINS_URL__"/>
<update-urls check="https://www.jetbrains.com/updates/updates.xml"
patches="https://download.jetbrains.com/idea/"/>
<help file="ideahelp.jar" root="idea"/>
<documentation url="https://www.jetbrains.com/help/idea"/>
......
......@@ -180,6 +180,9 @@ idea.fatal.error.notification=disabled
def builtinPluginsRepoUrl = ""
if (artifactsServer != null && buildContext.productProperties.productLayout.prepareCustomPluginRepositoryForPublishedPlugins) {
builtinPluginsRepoUrl = artifactsServer.urlToArtifact("${buildContext.applicationInfo.productCode}-plugins/plugins.xml")
if (!builtinPluginsRepoUrl.startsWith("https:")) {
buildContext.messages.error("Insecure artifact server: " + builtinPluginsRepoUrl)
}
}
BuildUtils.copyAndPatchFile(sourceFile.path, targetFile.path,
["BUILD_NUMBER": buildContext.fullBuildNumber, "BUILD_DATE": date, "BUILD": buildContext.buildNumber,
......
......@@ -193,7 +193,7 @@ public class ApplicationInfoImpl extends ApplicationInfoEx {
private static final String PROGRESS_SLIDE = "progressSlide";
private static final String PROGRESS_PERCENT = "progressPercent";
static final String DEFAULT_PLUGINS_HOST = "http://plugins.jetbrains.com";
static final String DEFAULT_PLUGINS_HOST = "https://plugins.jetbrains.com";
static final String IDEA_PLUGINS_HOST_PROPERTY = "idea.plugins.host";
ApplicationInfoImpl() {
......
......@@ -8,7 +8,6 @@ import com.intellij.ide.DataManager;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.plugins.newui.*;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.idea.IdeaApplication;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ApplicationNamesInfo;
......@@ -1128,7 +1127,7 @@ public class PluginManagerConfigurableNew
if (query.length() > 1) {
try {
for (String pluginId : requestToPluginRepository(createSearchSuggestUrl(query), forceHttps())) {
for (String pluginId : requestToPluginRepository(createSearchSuggestUrl(query))) {
IdeaPluginDescriptor descriptor = allRepositoriesMap.get(pluginId);
if (descriptor != null) {
result.add(descriptor);
......@@ -1203,7 +1202,7 @@ public class PluginManagerConfigurableNew
return;
}
for (String pluginId : requestToPluginRepository(createSearchUrl(parser.getUrlQuery(), 10000), forceHttps())) {
for (String pluginId : requestToPluginRepository(createSearchUrl(parser.getUrlQuery(), 10000))) {
IdeaPluginDescriptor descriptor = allRepositoriesMap.get(pluginId);
if (descriptor != null) {
result.descriptors.add(descriptor);
......@@ -1461,14 +1460,13 @@ public class PluginManagerConfigurableNew
public static boolean loadPlugins(@NotNull List<? super IdeaPluginDescriptor> descriptors,
@NotNull Map<String, IdeaPluginDescriptor> allDescriptors,
@NotNull String query) throws IOException {
boolean forceHttps = forceHttps();
Url baseUrl = createSearchUrl(query, ITEMS_PER_GROUP);
Url offsetUrl = baseUrl;
Map<String, String> offsetParameters = new HashMap<>();
int offset = 0;
while (true) {
List<String> pluginIds = requestToPluginRepository(offsetUrl, forceHttps);
List<String> pluginIds = requestToPluginRepository(offsetUrl);
if (pluginIds.isEmpty()) {
return false;
}
......@@ -1490,10 +1488,10 @@ public class PluginManagerConfigurableNew
}
@NotNull
public static List<String> requestToPluginRepository(@NotNull Url url, boolean forceHttps) throws IOException {
public static List<String> requestToPluginRepository(@NotNull Url url) throws IOException {
List<String> ids = new ArrayList<>();
HttpRequests.request(url).forceHttps(forceHttps).throwStatusCodeException(false).productNameAsUserAgent().connect(request -> {
HttpRequests.request(url).throwStatusCodeException(false).productNameAsUserAgent().connect(request -> {
URLConnection connection = request.getConnection();
if (connection instanceof HttpURLConnection && ((HttpURLConnection)connection).getResponseCode() != HttpURLConnection.HTTP_OK) {
return null;
......@@ -1533,11 +1531,6 @@ public class PluginManagerConfigurableNew
"&productCode=" + URLUtil.encodeURIComponent(instance.getBuild().getProductCode()));
}
public static boolean forceHttps() {
return IdeaApplication.isLoaded() && !ApplicationManager.getApplication().isDisposed() &&
UpdateSettings.getInstance().canUseSecureConnection();
}
@NotNull
private List<IdeaPluginDescriptor> getPluginRepositories() {
synchronized (myRepositoriesLock) {
......
......@@ -36,6 +36,7 @@ import com.intellij.ui.components.labels.LinkLabel;
import com.intellij.ui.components.labels.LinkListener;
import com.intellij.ui.popup.PopupFactoryImpl;
import com.intellij.ui.popup.list.PopupListElementRenderer;
import com.intellij.util.Url;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.net.HttpConfigurable;
import com.intellij.util.ui.JBDimension;
......@@ -665,9 +666,8 @@ public class PluginManagerConfigurableNewLayout
return;
}
for (String pluginId : PluginManagerConfigurableNew
.requestToPluginRepository(PluginManagerConfigurableNew.createSearchUrl(parser.getUrlQuery(), 10000),
PluginManagerConfigurableNew.forceHttps())) {
Url url = PluginManagerConfigurableNew.createSearchUrl(parser.getUrlQuery(), 10000);
for (String pluginId : PluginManagerConfigurableNew.requestToPluginRepository(url)) {
IdeaPluginDescriptor descriptor = allRepositoriesMap.get(pluginId);
if (descriptor != null) {
result.descriptors.add(descriptor);
......
......@@ -2,7 +2,6 @@
package com.intellij.ide.plugins;
import com.intellij.ide.IdeBundle;
import com.intellij.idea.IdeaApplication;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.PermanentInstallationID;
import com.intellij.openapi.application.ex.ApplicationInfoEx;
......@@ -90,19 +89,9 @@ public class RepositoryHelper {
return loadPlugins(repositoryUrl, null, indicator);
}
@NotNull
public static List<IdeaPluginDescriptor> loadPlugins(@Nullable String repositoryUrl,
@Nullable BuildNumber buildnumber,
@Nullable ProgressIndicator indicator) throws IOException {
boolean hostEligibleForHttpsForcing = repositoryUrl == null || repositoryUrl.equals(ApplicationInfoEx.getInstanceEx().getBuiltinPluginsUrl());
boolean forceHttps = hostEligibleForHttpsForcing && IdeaApplication.isLoaded() && UpdateSettings.getInstance().canUseSecureConnection();
return loadPlugins(repositoryUrl, buildnumber, forceHttps, indicator);
}
@NotNull
public static List<IdeaPluginDescriptor> loadPlugins(@Nullable String repositoryUrl,
@Nullable BuildNumber build,
boolean forceHttps,
@Nullable ProgressIndicator indicator) throws IOException {
String eTag;
File pluginListFile;
......@@ -129,7 +118,6 @@ public class RepositoryHelper {
Url finalUrl = url;
List<PluginNode> descriptors = HttpRequests.request(url)
.forceHttps(forceHttps)
.tuner(connection -> connection.setRequestProperty("If-None-Match", eTag))
.productNameAsUserAgent()
.connect(request -> {
......
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.plugins.newui;
import com.intellij.icons.AllIcons;
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.InstalledPluginsState;
import com.intellij.ide.plugins.PluginManagerConfigurableNew;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.ide.ui.LafManager;
import com.intellij.openapi.application.*;
......@@ -248,16 +247,9 @@ public class PluginLogo {
try {
Url url = Urls.newFromEncoded(ApplicationInfoImpl.getShadowInstance().getPluginManagerUrl() +
"/api/icon?pluginId=" + URLUtil.encodeURIComponent(idPlugin) + theme);
HttpRequests.request(url).forceHttps(PluginManagerConfigurableNew.forceHttps()).productNameAsUserAgent()
.connect(request -> {
request.getConnection();
request.saveToFile(file, null);
return null;
});
}
catch (HttpRequests.HttpStatusException ignore) {
HttpRequests.request(url).productNameAsUserAgent().saveToFile(file, null);
}
catch (HttpRequests.HttpStatusException ignore) { }
catch (IOException e) {
LOG.error(e);
}
......
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.updateSettings.impl;
import com.intellij.ide.IdeBundle;
......@@ -44,8 +44,7 @@ public class PluginDownloader {
private final String myPluginId;
private final String myPluginName;
@Nullable
private final String myProductCode;
private final @Nullable String myProductCode;
private final Date myReleaseDate;
private final int myReleaseVersion;
private final String myDescription;
......@@ -53,14 +52,13 @@ public class PluginDownloader {
private final String myPluginUrl;
private final BuildNumber myBuildNumber;
private final boolean myForceHttps;
private String myPluginVersion;
private IdeaPluginDescriptor myDescriptor;
private File myFile;
private File myOldFile;
private PluginDownloader(IdeaPluginDescriptor descriptor, String url, BuildNumber buildNumber, boolean forceHttps) {
private PluginDownloader(IdeaPluginDescriptor descriptor, String url, BuildNumber buildNumber) {
myPluginId = descriptor.getPluginId().getIdString();
myPluginName = descriptor.getName();
myProductCode = descriptor.getProductCode();
......@@ -71,7 +69,6 @@ public class PluginDownloader {
myPluginUrl = url;
myBuildNumber = buildNumber;
myForceHttps = forceHttps;
myPluginVersion = descriptor.getVersion();
myDescriptor = descriptor;
......@@ -236,7 +233,7 @@ public class PluginDownloader {
indicator.setText2(IdeBundle.message("progress.downloading.plugin", getPluginName()));
File file = FileUtil.createTempFile(pluginsTemp, "plugin_", "_download", true, false);
return HttpRequests.request(myPluginUrl).gzip(false).forceHttps(myForceHttps).productNameAsUserAgent().connect(request -> {
return HttpRequests.request(myPluginUrl).gzip(false).productNameAsUserAgent().connect(request -> {
request.saveToFile(file, indicator);
String fileName = guessFileName(request.getConnection(), file);
......@@ -292,15 +289,6 @@ public class PluginDownloader {
public static PluginDownloader createDownloader(@NotNull IdeaPluginDescriptor descriptor,
@Nullable String host,
@Nullable BuildNumber buildNumber) throws IOException {
boolean forceHttps = host == null && (ApplicationManager.getApplication() == null || UpdateSettings.getInstance().canUseSecureConnection());
return createDownloader(descriptor, host, buildNumber, forceHttps);
}
@NotNull
public static PluginDownloader createDownloader(@NotNull IdeaPluginDescriptor descriptor,
@Nullable String host,
@Nullable BuildNumber buildNumber,
boolean forceHttps) throws IOException {
String url;
try {
if (host != null && descriptor instanceof PluginNode) {
......@@ -329,7 +317,7 @@ public class PluginDownloader {
throw new IOException(e);
}
return new PluginDownloader(descriptor, url, buildNumber, forceHttps);
return new PluginDownloader(descriptor, url, buildNumber);
}
@NotNull
......
......@@ -104,7 +104,7 @@ object UpdateChecker {
*/
@JvmStatic
fun getPluginUpdates(): Collection<PluginDownloader>? =
checkPluginsUpdate(UpdateSettings.getInstance(), EmptyProgressIndicator(), null, ApplicationInfo.getInstance().build)
checkPluginsUpdate(EmptyProgressIndicator(), null, ApplicationInfo.getInstance().build)
private fun doUpdateAndShowResult(project: Project?,
fromSettings: Boolean,
......@@ -135,7 +135,7 @@ object UpdateChecker {
val updatedPlugins: Collection<PluginDownloader>?
val externalUpdates: Collection<ExternalUpdate>?
try {
updatedPlugins = checkPluginsUpdate(updateSettings, indicator, incompatiblePlugins, buildNumber)
updatedPlugins = checkPluginsUpdate(indicator, incompatiblePlugins, buildNumber)
externalUpdates = checkExternalUpdates(manualCheck, updateSettings, indicator)
}
catch (e: IOException) {
......@@ -149,7 +149,7 @@ object UpdateChecker {
UpdateSettings.getInstance().saveLastCheckedInfo()
ApplicationManager.getApplication().invokeLater({
showUpdateResult(project, result, updateSettings, updatedPlugins, incompatiblePlugins, externalUpdates, !fromSettings, manualCheck)
showUpdateResult(project, result, updatedPlugins, incompatiblePlugins, externalUpdates, !fromSettings, manualCheck)
callback?.setDone()
}, if (fromSettings) ModalityState.any() else ModalityState.NON_MODAL)
}
......@@ -164,7 +164,6 @@ object UpdateChecker {
LogUtil.debug(LOG, "load update xml (UPDATE_URL='%s')", updateUrl)
updateInfo = HttpRequests.request(updateUrl)
.forceHttps(settings.canUseSecureConnection())
.connect {
try {
if (settings.isPlatformUpdateEnabled)
......@@ -194,18 +193,12 @@ object UpdateChecker {
@JvmStatic
@Throws(IOException::class, JDOMException::class)
fun getUpdatesInfo(settings: UpdateSettings): UpdatesInfo? {
fun getUpdatesInfo(): UpdatesInfo? {
val updateUrl = Urls.newFromEncoded(updateUrl)
return HttpRequests.request(updateUrl)
.forceHttps(settings.canUseSecureConnection())
.connect {
UpdatesInfo(JDOMUtil.load(it.reader))
}
return HttpRequests.request(updateUrl).connect { UpdatesInfo(JDOMUtil.load(it.reader)) }
}
private fun checkPluginsUpdate(updateSettings: UpdateSettings,
indicator: ProgressIndicator?,
private fun checkPluginsUpdate(indicator: ProgressIndicator?,
incompatiblePlugins: MutableCollection<IdeaPluginDescriptor>?,
buildNumber: BuildNumber?): Collection<PluginDownloader>? {
val updateable = collectUpdateablePlugins()
......@@ -216,14 +209,13 @@ object UpdateChecker {
val state = InstalledPluginsState.getInstance()
outer@ for (host in RepositoryHelper.getPluginHosts()) {
try {
val forceHttps = host == null && updateSettings.canUseSecureConnection()
val list = RepositoryHelper.loadPlugins(host, buildNumber, forceHttps, indicator)
val list = RepositoryHelper.loadPlugins(host, buildNumber, indicator)
for (descriptor in list) {
val id = descriptor.pluginId
if (updateable.containsKey(id)) {
updateable.remove(id)
state.onDescriptorDownload(descriptor)
val downloader = PluginDownloader.createDownloader(descriptor, host, buildNumber, forceHttps)
val downloader = PluginDownloader.createDownloader(descriptor, host, buildNumber)
checkAndPrepareToInstall(downloader, state, toUpdate, incompatiblePlugins, indicator)
if (updateable.isEmpty()) {
break@outer
......@@ -363,7 +355,6 @@ object UpdateChecker {
private fun showUpdateResult(project: Project?,
checkForUpdateResult: CheckForUpdateResult,
updateSettings: UpdateSettings,
updatedPlugins: Collection<PluginDownloader>?,
incompatiblePlugins: Collection<IdeaPluginDescriptor>?,
externalUpdates: Collection<ExternalUpdate>?,
......@@ -374,9 +365,7 @@ object UpdateChecker {
if (updatedChannel != null && newBuild != null) {
val runnable = {
val patches = checkForUpdateResult.patches
val forceHttps = updateSettings.canUseSecureConnection()
UpdateInfoDialog(updatedChannel, newBuild, patches, enableLink, forceHttps, updatedPlugins, incompatiblePlugins).show()
UpdateInfoDialog(updatedChannel, newBuild, checkForUpdateResult.patches, enableLink, updatedPlugins, incompatiblePlugins).show()
}
ourShownNotifications.remove(NotificationUniqueType.PLATFORM)?.forEach { it.expire() }
......
......@@ -51,7 +51,6 @@ public class UpdateCheckerComponent implements Disposable, BaseComponent {
Disposer.register(this, myCheckForUpdatesAlarm);
updateDefaultChannel();
checkSecureConnection();
scheduleOnStartCheck();
cleanupPatch();
snapPackageNotification();
......@@ -79,15 +78,6 @@ public class UpdateCheckerComponent implements Disposable, BaseComponent {
}
}
private static void checkSecureConnection() {
UpdateSettings settings = UpdateSettings.getInstance();
if (settings.isSecureConnection() && !settings.canUseSecureConnection()) {
String title = IdeBundle.message("update.notifications.title");
String message = IdeBundle.message("update.sni.disabled.message");
UpdateChecker.NOTIFICATIONS.createNotification(title, message, NotificationType.WARNING, null).notify(null);
}
}
private void scheduleOnStartCheck() {
UpdateSettings settings = UpdateSettings.getInstance();
if (!settings.isCheckNeeded()) {
......@@ -178,7 +168,7 @@ public class UpdateCheckerComponent implements Disposable, BaseComponent {
if (!currentBuild.equals(lastBuildChecked)) {
UpdatesInfo updatesInfo = null;
try {
updatesInfo = UpdateChecker.getUpdatesInfo(UpdateSettings.getInstance());
updatesInfo = UpdateChecker.getUpdatesInfo();
}
catch (IOException | JDOMException e) {
LOG.warn(e);
......
......@@ -54,7 +54,6 @@ import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
*/
class UpdateInfoDialog extends AbstractUpdateDialog {
private final UpdateChannel myUpdatedChannel;
private final boolean myForceHttps;
private final Collection<? extends PluginDownloader> myUpdatedPlugins;
private final BuildInfo myNewBuild;
private final UpdateChain myPatches;
......@@ -66,12 +65,10 @@ class UpdateInfoDialog extends AbstractUpdateDialog {
@NotNull BuildInfo newBuild,
@Nullable UpdateChain patches,
boolean enableLink,
boolean forceHttps,
@Nullable Collection<? extends PluginDownloader> updatedPlugins,
@Nullable Collection<? extends IdeaPluginDescriptor> incompatiblePlugins) {
super(enableLink);
myUpdatedChannel = channel;
myForceHttps = forceHttps;
myUpdatedPlugins = updatedPlugins;
myNewBuild = newBuild;
myPatches = patches;
......@@ -98,7 +95,6 @@ class UpdateInfoDialog extends AbstractUpdateDialog {
UpdateInfoDialog(UpdateChannel channel, BuildInfo newBuild, UpdateChain patches, @Nullable File patchFile) {
super(true);
myUpdatedChannel = channel;
myForceHttps = true;
myUpdatedPlugins = null;
myNewBuild = newBuild;
myPatches = patches;
......@@ -201,7 +197,7 @@ class UpdateInfoDialog extends AbstractUpdateDialog {
String[] command;
try {
if (myPatches != null) {
List<File> files = UpdateInstaller.downloadPatchChain(myPatches.getChain(), myForceHttps, indicator);
List<File> files = UpdateInstaller.downloadPatchChain(myPatches.getChain(), indicator);
command = UpdateInstaller.preparePatchCommand(files, indicator);
}
else {
......
......@@ -36,7 +36,7 @@ object UpdateInstaller {
@JvmStatic
@Throws(IOException::class)
fun downloadPatchChain(chain: List<BuildNumber>, forceHttps: Boolean, indicator: ProgressIndicator): List<File> {
fun downloadPatchChain(chain: List<BuildNumber>, indicator: ProgressIndicator): List<File> {
indicator.text = IdeBundle.message("update.downloading.patch.progress")
val files = mutableListOf<File>()
......@@ -56,7 +56,7 @@ object UpdateInstaller {
super.setFraction((i - 1) * share + fraction / share)
}
}
HttpRequests.request(url).gzip(false).forceHttps(forceHttps).saveToFile(patchFile, partIndicator)
HttpRequests.request(url).gzip(false).saveToFile(patchFile, partIndicator)
ZipFile(patchFile).use {
if (it.getEntry(PATCH_FILE_NAME) == null || it.getEntry(UPDATER_ENTRY) == null) {
throw IOException("Corrupted patch file: ${patchFile.name}")
......
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.updateSettings.impl
import com.intellij.openapi.components.BaseState
......@@ -33,9 +33,6 @@ class UpdateOptions : BaseState() {
@get:OptionTag("UPDATE_CHANNEL_TYPE")
var updateChannelType by string(ChannelStatus.RELEASE.code)
@get:OptionTag("SECURE_CONNECTION")
var isUseSecureConnection by property(true)
@get:OptionTag("THIRD_PARTY_PLUGINS_ALLOWED")
var isThirdPartyPluginsAllowed by property(false)
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ import com.intellij.openapi.application.ApplicationInfo;
import com.intellij.openapi.components.*;
import com.intellij.openapi.updateSettings.UpdateStrategyCustomization;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.net.NetUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
......@@ -68,14 +67,6 @@ public class UpdateSettings implements PersistentStateComponent<UpdateOptions> {
return myState.getExternalUpdateChannels();
}
public boolean isSecureConnection() {
return myState.isUseSecureConnection();
}
public void setSecureConnection(boolean value) {
myState.setUseSecureConnection(value);
}
public long getLastTimeChecked() {
return myState.getLastTimeChecked();
}
......@@ -133,10 +124,6 @@ public class UpdateSettings implements PersistentStateComponent<UpdateOptions> {
myState.setLastBuildChecked(ApplicationInfo.getInstance().getBuild().asString());
}
public boolean canUseSecureConnection() {
return myState.isUseSecureConnection() && NetUtils.isSniEnabled();
}
public boolean isThirdPartyPluginsAllowed() {
return myState.isThirdPartyPluginsAllowed();
}
......
......@@ -20,7 +20,6 @@ import com.intellij.ui.CollectionComboBoxModel;
import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.labels.ActionLink;
import com.intellij.util.net.NetUtils;
import com.intellij.util.text.DateFormatUtil;
import com.intellij.util.ui.JBEmptyBorder;
import org.jetbrains.annotations.NotNull;
......@@ -71,10 +70,6 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable {
@Override
public void apply() throws ConfigurationException {
if (myPanel.myUseSecureConnection.isSelected() && !NetUtils.isSniEnabled()) {
throw new ConfigurationException(IdeBundle.message("update.sni.disabled.error"));
}
boolean wasEnabled = mySettings.isCheckNeeded();
mySettings.setCheckNeeded(myPanel.myCheckForUpdates.isSelected());
if (wasEnabled != mySettings.isCheckNeeded()) {
......@@ -90,30 +85,20 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable {
}
mySettings.setSelectedChannelStatus(myPanel.getSelectedChannelType());
mySettings.setSecureConnection(myPanel.myUseSecureConnection.isSelected());
}
@Override
public void reset() {
myPanel.myCheckForUpdates.setSelected(mySettings.isCheckNeeded());
myPanel.myUseSecureConnection.setSelected(mySettings.isSecureConnection());
myPanel.updateLastCheckedLabel();
myPanel.setSelectedChannelType(mySettings.getSelectedActiveChannel());
}
@Override
public boolean isModified() {
if (myPanel == null) {
return false;
}
if (mySettings.isCheckNeeded() != myPanel.myCheckForUpdates.isSelected() ||
mySettings.isSecureConnection() != myPanel.myUseSecureConnection.isSelected()) {
return true;
}
Object channel = myPanel.myUpdateChannels.getSelectedItem();
return channel != null && !channel.equals(mySettings.getSelectedActiveChannel());
return myPanel != null &&
(myPanel.myCheckForUpdates.isSelected() != mySettings.isCheckNeeded() ||
myPanel.myUpdateChannels.getSelectedItem() != mySettings.getSelectedActiveChannel());
}
@Override
......@@ -128,7 +113,6 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable {
private JComboBox<ChannelStatus> myUpdateChannels;
private JButton myCheckNow;
private JBLabel myChannelWarning;
private JCheckBox myUseSecureConnection;
private JLabel myBuildNumber;
private JLabel myVersionNumber;
private JLabel myLastCheckedDate;
......@@ -167,7 +151,6 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable {
UpdateSettings settings = new UpdateSettings();
settings.loadState(mySettings.getState());
settings.setSelectedChannelStatus(getSelectedChannelType());
settings.setSecureConnection(myUseSecureConnection.isSelected());
UpdateChecker.updateAndShowResult(project, settings);
updateLastCheckedLabel();
});
......
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.openapi.updateSettings.impl.UpdateSettingsConfigurable.UpdatesSettingsPanel">
<grid id="5aa87" binding="myPanel" layout-manager="GridLayoutManager" row-count="10" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="5aa87" binding="myPanel" layout-manager="GridLayoutManager" row-count="9" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="62" y="37" width="816" height="434"/>
......@@ -40,17 +40,9 @@
<visible value="false"/>
</properties>
</component>
<component id="fc5f1" class="javax.swing.JCheckBox" binding="myUseSecureConnection">
<constraints>
<grid row="2" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/IdeBundle" key="updates.settings.secure"/>
</properties>
</component>
<component id="456b6" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=" "/>
......@@ -58,7 +50,7 @@
</component>
<component id="db163" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/IdeBundle" key="updates.settings.last.check"/>
......@@ -66,7 +58,7 @@
</component>
<component id="6b5cb" class="javax.swing.JLabel" binding="myLastCheckedDate">
<constraints>
<grid row="4" column="1" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="3" column="1" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="01.05.2005"/>
......@@ -74,7 +66,7 @@
</component>
<component id="36fbb" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/IdeBundle" key="updates.settings.current.version"/>
......@@ -82,7 +74,7 @@
</component>
<component id="bd9c5" class="javax.swing.JLabel" binding="myVersionNumber">
<constraints>
<grid row="5" column="1" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="4" column="1" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="4.5.4"/>
......@@ -90,7 +82,7 @@
</component>
<component id="6af7e" class="javax.swing.JLabel">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/IdeBundle" key="updates.settings.build.number"/>
......@@ -98,7 +90,7 @@
</component>
<component id="b6709" class="javax.swing.JLabel" binding="myBuildNumber">
<constraints>
<grid row="6" column="1" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="5" column="1" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="3352"/>
......@@ -106,7 +98,7 @@
</component>
<component id="51da0" class="javax.swing.JLabel">
<constraints>
<grid row="7" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=" "/>
......@@ -114,20 +106,15 @@
</component>
<component id="23c67" class="com.intellij.ui.components.labels.ActionLink" binding="myIgnoredBuildsLink" custom-create="true">
<constraints>
<grid row="8" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="7" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/IdeBundle" key="updates.settings.ignored"/>
</properties>
</component>
<hspacer id="fdc69">
<constraints>
<grid row="2" column="4" row-span="7" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<vspacer id="3d6db">
<constraints>
<grid row="9" column="0" row-span="1" col-span="5" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="8" column="0" row-span="1" col-span="5" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
......
......@@ -9,7 +9,6 @@ import com.google.gson.stream.JsonReader;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.plugins.*;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.idea.IdeaApplication;
import com.intellij.notification.*;
import com.intellij.openapi.application.*;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
......@@ -151,7 +150,6 @@ public class PluginsAdvertiser implements StartupActivity {
}
return HttpRequests.request(url.addParameters(params))
.forceHttps(IdeaApplication.isLoaded() && UpdateSettings.getInstance().canUseSecureConnection())
.productNameAsUserAgent()
.connect(requestProcessor, errorValue, LOG);
}
......
......@@ -1010,7 +1010,6 @@ updates.settings.checkbox.external=Automatically check for plugin updates
updates.settings.external=IDE updates are managed externally by {0}
updates.settings.channel.locked=EAP builds can only be updated from the EAP channel
updates.settings.unstable=Please note that this channel is less stable than your current one.
updates.settings.secure=Use secure connection
updates.settings.build.number=Build number
updates.settings.current.version=Current version
updates.settings.last.check=Last checked
......@@ -1030,9 +1029,6 @@ update.restart.plugins.update.action=&Update and Restart
update.shutdown.plugins.update.action=&Update and Shutdown
update.channel.enforced=Update channel switched to ''{0}''
update.sni.disabled.error=Secure connection is impossible with 'jsse.enableSNIExtension' property set to false
update.sni.disabled.message=We wanted your IDE to receive upgrades over a secure connection. \
Unfortunately, this doesn't work with the 'jsse.enableSNIExtension' property set to 'false'. \
The IDE will use plain HTTP connections when checking for updates.
update.apply.manually.message=Unfortunately, the IDE is not capable of an automatic update on your system.\n \
Please quit the IDE and apply the patch manually by launching this script:\n{0}.
update.ready.message=The IDE is ready for update. <a href="#">Restart</a>?
......
......@@ -9,9 +9,9 @@
<welcome-screen logo-url="/Logo_welcomeScreen.png"/>
<plugins url="http://plugins.jetbrains.com/"/>
<update-urls check="http://www.jetbrains.com/updates/updates.xml"
patches="http://download.jetbrains.com/idea/"/>
<plugins url="https://plugins.jetbrains.com/"/>
<update-urls check="https://www.jetbrains.com/updates/updates.xml"
patches="https://download.jetbrains.com/idea/"/>
<help file="ideahelp.jar" root="idea"/>
<documentation url="https://www.jetbrains.com/idea/documentation"/>
......
......@@ -141,6 +141,6 @@ public class RepositoryHelperTest {
File tempFile = tempDir.newFile("repo.xml");
FileUtil.writeToFile(tempFile, data);
String url = tempFile.toURI().toURL().toString();
return RepositoryHelper.loadPlugins(url, null, false, null);
return RepositoryHelper.loadPlugins(url, null, null);
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment