Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8280385

JavaFX Image not supporting SSL certificate

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10, JavaFX 14.02 (latest)

      A DESCRIPTION OF THE PROBLEM :
      We have a valid SSL certificate on our web server. All browsers support this company, but JavaFX does not appear to support it.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Load the following image via https in JavaFX.
      https://chalkboardscdn.dev/POSData/POSItemMedia/DEMFFF3_DEMFFF3/media_1.jpg

      Using the attached sample program: the URL above is hard-coded.
      1. Click the 'Load' button and image is not loaded. Copy the URL to system clipboard and paste it in any, the image is loaded.
      2. In the textfield, delete the s in https and click load again. The image is loaded.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Image is loaded
      ACTUAL -
      Image fails to load (no error given, how does it help to hide errors? )

      ---------- BEGIN SOURCE ----------
      package com.test;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.TextField;
      import javafx.scene.image.Image;
      import javafx.scene.image.ImageView;
      import javafx.scene.input.Clipboard;
      import javafx.scene.input.ClipboardContent;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.Priority;
      import javafx.stage.Stage;

      public class SSLbugMain extends Application {

      @Override
      public void start(Stage primaryStage) {

      ImageView imageView = new ImageView();
      imageView.setFitHeight(180d);

      imageView.setPreserveRatio(true);
      TextField textField = new TextField(
      "https://chalkboardscdn.dev/POSData/POSItemMedia/DEMFFF3_DEMFFF3/media_1.jpg");

      BorderPane borderPane = new BorderPane();
      HBox hbox = new HBox();
      hbox.getChildren().add(textField);
      HBox.setHgrow(textField, Priority.ALWAYS);

      Button button = new Button(" Load");
      button.setOnAction(e -> {
      Image image = new Image(textField.getText());
      imageView.setImage(image);
      });

      hbox.getChildren().add(button);
      button = new Button(" Copy");
      button.setOnAction(e -> {
      ClipboardContent content = new ClipboardContent();
      content.putString(textField.getText());

      Clipboard.getSystemClipboard().setContent(content);
      });

      hbox.getChildren().add(button);
      borderPane.setTop(hbox);

      borderPane.setMinHeight(200);
      borderPane.setMinWidth(400);

      borderPane.setCenter(imageView);
      Scene scene = new Scene(borderPane);

      primaryStage.setScene(scene);
      primaryStage.show();

      }

      public static void main(String[] args) {
      launch(args);
      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kcr Kevin Rushforth
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: