diff --git a/src/com/machinepublishers/jbrowserdriver/Util.java b/src/com/machinepublishers/jbrowserdriver/Util.java index e7932a92..104f7251 100644 --- a/src/com/machinepublishers/jbrowserdriver/Util.java +++ b/src/com/machinepublishers/jbrowserdriver/Util.java @@ -38,6 +38,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.net.ssl.SSLProtocolException; + import com.machinepublishers.browser.Browser; class Util { @@ -176,7 +178,7 @@ static String toString(InputStream inputStream, String charset) { BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, charset), chars.length); try { for (int len; -1 != (len = reader.read(chars, 0, chars.length)); builder.append(chars, 0, len)); - } catch (EOFException e) {} + } catch (EOFException | SSLProtocolException e) {} return builder.toString(); } catch (Throwable t) { return null; @@ -191,7 +193,7 @@ static byte[] toBytes(InputStream inputStream) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(bytes.length); try { for (int len = 0; -1 != (len = inputStream.read(bytes, 0, bytes.length)); out.write(bytes, 0, len)); - } catch (EOFException e) {} + } catch (EOFException | SSLProtocolException e) {} return out.toByteArray(); } finally { close(inputStream);