New upstream version 8.5.18
Emmanuel Bourg
6 years ago
24 | 24 | # ----- Version Control Flags ----- |
25 | 25 | version.major=8 |
26 | 26 | version.minor=5 |
27 | version.build=17 | |
27 | version.build=18 | |
28 | 28 | version.patch=0 |
29 | 29 | version.suffix= |
30 | 30 |
565 | 565 | <exclude name="test/webresources/**"/> |
566 | 566 | <!-- Exclude test files with unusual encodings --> |
567 | 567 | <exclude name="test/webapp/jsp/encoding/**"/> |
568 | <!-- Exclude developer specific local files --> | |
569 | <exclude name="build.properties" /> | |
570 | <exclude name="res/maven/mvn.properties" /> | |
568 | 571 | </fileset> |
569 | 572 | <fileset dir="modules/jdbc-pool" > |
570 | 573 | <exclude name=".*/**"/> |
1327 | 1330 | <fileset dir="test"> |
1328 | 1331 | <include name="META-INF/**"/> |
1329 | 1332 | <include name="**/service-config.txt"/> |
1333 | <include name="**/logging-non-rotatable.properties"/> | |
1330 | 1334 | </fileset> |
1331 | 1335 | </copy> |
1332 | 1336 | </target> |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | propertyNotFound = Propiedad [{1}] no hallada en el tipo [{0}] |
15 | 16 | propertyNotReadable = Propiedad [{1}] no legible para el tipo [{0}] |
16 | 17 | propertyNotWritable = Propiedad [{1}] no grabable para el tipo [{0}] |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | err.not_iso8859_1 = No es un car\u00E1cter ISO 8859-1: [{0}] |
15 | 16 | value.true = true |
16 | 17 | value.false = false |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | err.cookie_name_is_token = El nombre de Cookie [{0}] es una palabra reservada |
15 | 16 | err.cookie_name_blank = El nombre del Cookie no puede ser nulo o de longitud cero |
16 | 17 | err.io.negativelength = Longitud Negativa en el metodo write |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | authenticator.certificates = No hay cadena de certificados del cliente en esta petici\u00F3n |
15 | 16 | authenticator.formlogin = Referencia directa al formulario de conexi\u00F3n (p\u00E1gina de formulario de login) inv\u00E1lida |
16 | 17 | authenticator.loginFail = No pude ingresar |
1054 | 1054 | CharChunk cc = uri.getCharChunk(); |
1055 | 1055 | cc.allocate(length, -1); |
1056 | 1056 | |
1057 | String enc = connector.getURIEncoding(); | |
1058 | if (enc != null) { | |
1059 | B2CConverter conv = request.getURIConverter(); | |
1060 | try { | |
1061 | if (conv == null) { | |
1062 | conv = new B2CConverter(B2CConverter.getCharset(enc), true); | |
1063 | request.setURIConverter(conv); | |
1064 | } else { | |
1065 | conv.recycle(); | |
1066 | } | |
1067 | } catch (IOException e) { | |
1068 | log.error(sm.getString("coyoteAdapter.invalidEncoding")); | |
1069 | connector.setURIEncoding(null); | |
1070 | } | |
1071 | if (conv != null) { | |
1072 | try { | |
1073 | conv.convert(bc, cc, true); | |
1074 | uri.setChars(cc.getBuffer(), cc.getStart(), cc.getLength()); | |
1075 | return; | |
1076 | } catch (IOException ioe) { | |
1077 | // Should never happen as B2CConverter should replace | |
1078 | // problematic characters | |
1079 | request.getResponse().sendError( | |
1080 | HttpServletResponse.SC_BAD_REQUEST); | |
1081 | } | |
1082 | } | |
1083 | } | |
1084 | ||
1085 | // Default encoding: fast conversion for ISO-8859-1 | |
1086 | byte[] bbuf = bc.getBuffer(); | |
1087 | char[] cbuf = cc.getBuffer(); | |
1088 | int start = bc.getStart(); | |
1089 | for (int i = 0; i < length; i++) { | |
1090 | cbuf[i] = (char) (bbuf[i + start] & 0xff); | |
1091 | } | |
1092 | uri.setChars(cbuf, 0, length); | |
1057 | Charset charset = connector.getURICharset(); | |
1058 | ||
1059 | B2CConverter conv = request.getURIConverter(); | |
1060 | if (conv == null) { | |
1061 | conv = new B2CConverter(charset, true); | |
1062 | request.setURIConverter(conv); | |
1063 | } else { | |
1064 | conv.recycle(); | |
1065 | } | |
1066 | ||
1067 | try { | |
1068 | conv.convert(bc, cc, true); | |
1069 | uri.setChars(cc.getBuffer(), cc.getStart(), cc.getLength()); | |
1070 | } catch (IOException ioe) { | |
1071 | // Should never happen as B2CConverter should replace | |
1072 | // problematic characters | |
1073 | request.getResponse().sendError(HttpServletResponse.SC_BAD_REQUEST); | |
1074 | } | |
1093 | 1075 | } |
1094 | 1076 | |
1095 | 1077 |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | coyoteAdapter.accesslogFail=Exception while attempting to add an entry to the access log |
15 | 16 | coyoteAdapter.asyncDispatch=Exception while processing an asynchronous request |
16 | 17 | coyoteAdapter.authenticate=Authenticated user [{0}] provided by connector |
18 | 19 | coyoteAdapter.checkRecycled.request=Encountered a non-recycled request and recycled it forcedly. |
19 | 20 | coyoteAdapter.checkRecycled.response=Encountered a non-recycled response and recycled it forcedly. |
20 | 21 | coyoteAdapter.debug=The variable [{0}] has value [{1}] |
21 | coyoteAdapter.invalidEncoding=Invalid URI encoding, using HTTP default | |
22 | 22 | coyoteAdapter.parsePathParam=Unable to parse the path parameters using encoding [{0}]. The path parameters in the URL will be ignored. |
23 | 23 | |
24 | 24 | coyoteConnector.invalidEncoding=The encoding [{0}] is not recognised by the JRE. The Connector will continue to use [{1}] |
983 | 983 | */ |
984 | 984 | @Override |
985 | 985 | public String getCharacterEncoding() { |
986 | Charset charset = coyoteRequest.getCharset(); | |
987 | if (charset != null) { | |
988 | return charset.name(); | |
986 | String characterEncoding = coyoteRequest.getCharacterEncoding(); | |
987 | if (characterEncoding != null) { | |
988 | return characterEncoding; | |
989 | 989 | } |
990 | 990 | |
991 | 991 | Context context = getContext(); |
998 | 998 | |
999 | 999 | |
1000 | 1000 | private Charset getCharset() { |
1001 | Charset charset = coyoteRequest.getCharset(); | |
1001 | Charset charset = null; | |
1002 | try { | |
1003 | charset = coyoteRequest.getCharset(); | |
1004 | } catch (UnsupportedEncodingException e) { | |
1005 | // Ignore | |
1006 | } | |
1002 | 1007 | if (charset != null) { |
1003 | 1008 | return charset; |
1004 | 1009 | } |
2909 | 2914 | partsParseException = e; |
2910 | 2915 | } |
2911 | 2916 | } finally { |
2917 | // This might look odd but is correct. setParseFailedReason() only | |
2918 | // sets the failure reason if none is currently set. This code could | |
2919 | // be more efficient but it is written this way to be robust with | |
2920 | // respect to changes in the remainder of the method. | |
2912 | 2921 | if (partsParseException != null || !success) { |
2913 | 2922 | parameters.setParseFailedReason(FailReason.UNKNOWN); |
2914 | 2923 | } |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | applicationContext.addFilter.ise = No se pueden a\u00F1adir filtros al contexto [{0}] ya que \u00E9ste ha sido inicializado |
15 | 16 | applicationContext.addListener.iae.cnfe = No puedo crear una instancia del tipo [{0}] |
16 | 17 | applicationContext.addListener.iae.wrongType = El tipo especificado [{0}] no es uno de los tipos de escuchador esperados |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | namingResources.cleanupCloseFailed=Failed to invoke method [{0}] for resource [{1}] in container [{2}] so no cleanup was performed for that resource |
15 | 16 | namingResources.cleanupCloseSecurity=Unable to retrieve method [{0}] for resource [{1}] in container [{2}] so no cleanup was performed for that resource |
16 | 17 | namingResources.cleanupNoClose=Resource [{0}] in container [{1}] does not have a [{2}] method so no cleanup was performed for that resource |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | addDefaultCharset.unsupportedCharset = El conjunto especificado de caracteres [{0}] no se encuentra soportado |
15 | 16 | csrfPrevention.invalidRandomClass = No pude crear fuente al azar usando la clase [{0}] |
16 | 17 | filterbase.noSuchProperty = La propiedad [{0}] no est\u00E1 definida para los filtros del tipo [{1}] |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | deltaManager.createSession.newSession = Creada una DeltaSession con Id [{0}] Total contador=[{1}] |
15 | 16 | deltaManager.createMessage.access = Gestor [{0}]: creado mensaje de sesi\u00F3n [{1}] acceso. |
16 | 17 | deltaManager.createMessage.accessChangePrimary = Gestor [{0}]: creado mensaje de sesi\u00F3n [{1}] acceso para cambiar el primario. |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | webappClassLoader.illegalJarPath = Detectada entrada ilegal de JAR con nombre [{0}] |
15 | 16 | webappClassLoader.jdbcRemoveFailed = Ha fallado el desregistro del conductor JDBC para la aplicaci\u00F3n web [{0}] |
16 | 17 | webappClassLoader.stopped = Acceso ilegal: esta instancia de aplicaci\u00F3n web ya ha sido parada. Could not load [{0}]. La eventual traza de pila que sigue ha sido motivada por un error lanzado con motivos de depuraci\u00F3n as\u00ED como para intentar terminar el hilo que motiv\u00F3 el acceso ilegal y no tiene impacto funcional. |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | htmlManagerServlet.appsAvailable = Ejecut\u00E1ndose |
15 | 16 | htmlManagerServlet.appsName = Nombre a Mostrar |
16 | 17 | htmlManagerServlet.appsPath = Trayectoria |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | hostManagerServlet.alreadyStarted = FALLO - La m\u00E1qiuina [{0}] ya ha arrancado |
15 | 16 | hostManagerServlet.alreadyStopped = FALLO - La m\u00E1quina [{0}] ya se ha parado |
16 | 17 | hostManagerServlet.appBaseCreateFail = FALLO - No pude crear appBase [{0}] para la m\u00E1quina [{1}] |
0 | jaasRealm.beginLogin = JAASRealm login requerido para nombre de usuario [{0}] usando LoginContext para aplicaci\u00F3n [{1}] | |
1 | 0 | # Licensed to the Apache Software Foundation (ASF) under one or more |
2 | 1 | # contributor license agreements. See the NOTICE file distributed with |
3 | 2 | # this work for additional information regarding copyright ownership. |
18 | 17 | jaasRealm.accountExpired = El usuario [{0}] NO ha sido autentificado porque ha expirado su cuenta |
19 | 18 | jaasRealm.authenticateFailure = Nombre de usuario [{0}] NO autenticado con \u00E9xito |
20 | 19 | jaasRealm.authenticateSuccess = Nombre de usuario [{0}] autenticado con \u00E9xito como Principal [{1}] -- Tambi\u00E9n se ha creado el Asunto |
20 | jaasRealm.beginLogin = JAASRealm login requerido para nombre de usuario [{0}] usando LoginContext para aplicaci\u00F3n [{1}] | |
21 | 21 | jaasRealm.credentialExpired = El usuario [{0}] NO ha sido autentificado porque ha expirado su credencial |
22 | 22 | jaasRealm.failedLogin = El usuario [{0}] NO ha sido autentificado porque ha fallado el login |
23 | 23 | jaasRealm.loginException = Excepci\u00F3n de Login autenticando nombre de usuario [{0}] |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | SecurityUtil.doAsPrivilege = Ha tenido lugar una excepci\u00F3n al ejecutar el bloque PrivilegedExceptionAction. |
15 | 16 | SecurityListener.checkUmaskFail = Intentado arranque con valor de umask de [{0}]. Ejecutando Tomcat sin umask al menos tan restrictivo como [{1}] ha sido bloqueado por el oyente de Ciclo de Vida org.apache.catalina.security.SecurityListener (normalmente configurado en CATALINA_BASE/conf/server.xml) |
16 | 17 | SecurityListener.checkUmaskNone = No se ha hallado valor de umask en propiedad de sistema [{0}]. Si embargo, parece que Tomcat est\u00E1 siendo ejecutado en una plataforma que soporta umask. La propiedad del sistema se pone normalmente en CATALINA_HOME/bin/catalina.sh. El oyente de Ciclo de Vida org.apache.catalina.security.SecurityListener (normalmente configurado en CATALINA_BASE/conf/server.xml) espera un umask al menos tan restrictivo como [{1}] |
968 | 968 | ranges = FULL; |
969 | 969 | } |
970 | 970 | |
971 | String outputEncoding = response.getCharacterEncoding(); | |
972 | Charset charset = B2CConverter.getCharset(outputEncoding); | |
973 | boolean conversionRequired; | |
974 | if (!usingPrecompressedVersion && isText(contentType) && | |
975 | !charset.equals(fileEncodingCharset)) { | |
976 | conversionRequired = true; | |
977 | // Conversion often results fewer/more/different bytes. | |
978 | // That does not play nicely with range requests. | |
979 | ranges = FULL; | |
980 | } else { | |
981 | conversionRequired = false; | |
982 | } | |
983 | ||
971 | 984 | if (resource.isDirectory() || |
972 | 985 | isError || |
973 | 986 | ( (ranges == null || ranges.isEmpty()) |
987 | 1000 | log("DefaultServlet.serveFile: contentLength=" + |
988 | 1001 | contentLength); |
989 | 1002 | // Don't set a content length if something else has already |
990 | // written to the response. | |
991 | if (contentWritten == 0) { | |
1003 | // written to the response or if conversion will be taking place | |
1004 | if (contentWritten == 0 && !conversionRequired) { | |
992 | 1005 | response.setContentLengthLong(contentLength); |
993 | 1006 | } |
994 | 1007 | } |
1016 | 1029 | } else { |
1017 | 1030 | // Output is content of resource |
1018 | 1031 | // Check to see if conversion is required |
1019 | String outputEncoding = response.getCharacterEncoding(); | |
1020 | Charset charset = B2CConverter.getCharset(outputEncoding); | |
1021 | if (!isText(contentType) || charset.equals(fileEncodingCharset)) { | |
1032 | if (conversionRequired) { | |
1033 | // A conversion is required from fileEncoding to | |
1034 | // response encoding | |
1035 | byte[] resourceBody = resource.getContent(); | |
1036 | InputStream source; | |
1037 | if (resourceBody == null) { | |
1038 | source = resource.getInputStream(); | |
1039 | } else { | |
1040 | source = new ByteArrayInputStream(resourceBody); | |
1041 | } | |
1042 | OutputStreamWriter osw = new OutputStreamWriter(ostream, charset); | |
1043 | PrintWriter pw = new PrintWriter(osw); | |
1044 | copy(source, pw, fileEncoding); | |
1045 | pw.flush(); | |
1046 | } else { | |
1022 | 1047 | if (!checkSendfile(request, response, resource, |
1023 | 1048 | contentLength, null)) { |
1024 | 1049 | // sendfile not possible so check if resource |
1033 | 1058 | ostream.write(resourceBody); |
1034 | 1059 | } |
1035 | 1060 | } |
1036 | } else { | |
1037 | // A conversion is required from fileEncoding to | |
1038 | // response encoding | |
1039 | byte[] resourceBody = resource.getContent(); | |
1040 | InputStream source; | |
1041 | if (resourceBody == null) { | |
1042 | source = resource.getInputStream(); | |
1043 | } else { | |
1044 | source = new ByteArrayInputStream(resourceBody); | |
1045 | } | |
1046 | OutputStreamWriter osw = new OutputStreamWriter(ostream, charset); | |
1047 | PrintWriter pw = new PrintWriter(osw); | |
1048 | copy(source, pw, fileEncoding); | |
1049 | pw.flush(); | |
1050 | 1061 | } |
1051 | 1062 | } |
1052 | 1063 | // If a stream was configured, it needs to be copied to |
0 | defaultServlet.missingResource = El recurso requerido [{0}] no se encuentra disponible | |
1 | 0 | # Licensed to the Apache Software Foundation (ASF) under one or more |
2 | 1 | # contributor license agreements. See the NOTICE file distributed with |
3 | 2 | # this work for additional information regarding copyright ownership. |
12 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | 12 | # See the License for the specific language governing permissions and |
14 | 13 | # limitations under the License. |
14 | ||
15 | defaultServlet.missingResource = El recurso requerido [{0}] no se encuentra disponible | |
15 | 16 | defaultservlet.skipfail = S\u00F3lo se han saltado [{0}] cuando se requirieron [{1}] |
16 | 17 | webdavservlet.jaxpfailed = Fall\u00F3 la inicializaci\u00F3n de JAXP |
17 | 18 | webdavservlet.enternalEntityIgnored = El requerimiento inclu\u00EDa una referencia a una entidad externa con PublicID [{0}] y SystemID [{1}] que fue ignorada |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | fileStore.saving = Salvando Sesi\u00F3n [{0}] en archivo [{1}] |
15 | 16 | fileStore.loading = Cargando Sesi\u00F3n [{0}] desde archivo [{1}] |
16 | 17 | fileStore.removing = Quitando Sesi\u00F3n [{0}] en archivo [{1}] |
17 | 17 | |
18 | 18 | |
19 | 19 | import java.io.IOException; |
20 | import java.io.UnsupportedEncodingException; | |
20 | 21 | import java.net.URL; |
21 | 22 | import java.net.URLConnection; |
22 | 23 | import java.nio.charset.Charset; |
250 | 251 | // Get encoding settings from request / connector if |
251 | 252 | // possible |
252 | 253 | if (req instanceof Request) { |
253 | requestCharset = ((Request)req).getCoyoteRequest().getCharset(); | |
254 | try { | |
255 | requestCharset = ((Request)req).getCoyoteRequest().getCharset(); | |
256 | } catch (UnsupportedEncodingException e) { | |
257 | // Ignore | |
258 | } | |
254 | 259 | Connector connector = ((Request)req).getConnector(); |
255 | 260 | uriCharset = connector.getURICharset(); |
256 | 261 | useBodyEncodingForURI = connector.getUseBodyEncodingForURI(); |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | catalina.configFail = No pude cargar la configuraci\u00F3n del servidor desde [{0}] |
15 | 16 | catalina.shutdownHookFail = El gancho de apagado ha experimentado un error al intentar para el servidor |
16 | 17 | catalina.stopServer = No se ha configurado puerto de apagado. Apagando el servidor a trav\u00E9s de se\u00F1al de SO. Servidor no apagado. |
59 | 59 | // create registry |
60 | 60 | registry = new JmxRegistry(); |
61 | 61 | registry.baseOname = baseOn; |
62 | registryCache.putIfAbsent(channel.getName(), registry); | |
62 | // It doesn't matter if existing object gets over-written. This object | |
63 | // holds minimal state and that state will be the same for all objects | |
64 | // created for the same channel. | |
65 | registryCache.put(channel.getName(), registry); | |
63 | 66 | return registry; |
64 | 67 | } |
65 | 68 |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | bioSender.ack.eof = EOF alcanzado en puerto local [{0}:{1,number,integer}] |
15 | 16 | bioSender.ack.missing = No puedo leer reconocimiento desde [{0}:{1,number,integer}] en {2,number,integer} ms. Desconectando conector e intentando otra vez. |
16 | 17 | bioSender.ack.wrong = Falta ACK correcto tras 10 bytes le\u00EDdos en puerto local [{0}:{1,number,integer}] |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | memoryUserDatabase.notPersistable = La base de datos de usuario no es persistible - no hay permisos de grabaci\u00F3n sobre el directorio |
15 | 16 | memoryUserDatabase.nullGroup = Se ha especificado un nombre de grupo nulo o de tama\u00F1o cero. Se ignora el grupo. |
16 | 17 | memoryUserDatabase.nullRole = Se ha especificado un nombre rol nulo o de tama\u00F1o cero. Se ignora el rol. |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | parameterMap.locked = No se permiten modificaciones en un ParameterMap bloqueado |
15 | 16 | resourceSet.locked = No se permiten modificaciones en un ResourceSet bloqueado |
16 | 17 | hexUtil.bad = D\u00EDgito hexadecimal incorrecto |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | jdbcAccessLogValve.exception = Excepci\u00F3n realizando entrada de acceso a inserci\u00F3n |
15 | 16 | accessLogValve.closeFail = No pude cerrar fichero de historial |
16 | 17 | accessLogValve.openDirFail = No pude crear directorio [{0}] para historiales de acceso |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | abstractConnectionHandler.connectionsGet=Found processor [{0}] for socket [{1}] |
15 | 16 | abstractConnectionHandler.error=Error reading request, ignored |
16 | 17 | abstractConnectionHandler.ioexception.debug=IOExceptions are normal, ignored |
130 | 130 | private long contentLength = -1; |
131 | 131 | private MessageBytes contentTypeMB = null; |
132 | 132 | private Charset charset = null; |
133 | // Retain the original, user specified character encoding so it can be | |
134 | // returned even if it is invalid | |
135 | private String characterEncoding = null; | |
136 | ||
133 | 137 | /** |
134 | 138 | * Is there an expectation ? |
135 | 139 | */ |
287 | 291 | * @return The value set via {@link #setCharacterEncoding(String)} or if no |
288 | 292 | * call has been made to that method try to obtain if from the |
289 | 293 | * content type. |
290 | * | |
291 | * @deprecated This method will be removed in Tomcat 9.0.x | |
292 | */ | |
293 | @Deprecated | |
294 | */ | |
294 | 295 | public String getCharacterEncoding() { |
295 | Charset charset = getCharset(); | |
296 | if (charset == null) { | |
297 | return null; | |
298 | } | |
299 | return charset.name(); | |
296 | if (characterEncoding == null) { | |
297 | characterEncoding = getCharsetFromContentType(getContentType()); | |
298 | } | |
299 | ||
300 | return characterEncoding; | |
300 | 301 | } |
301 | 302 | |
302 | 303 | |
306 | 307 | * @return The value set via {@link #setCharacterEncoding(String)} or if no |
307 | 308 | * call has been made to that method try to obtain if from the |
308 | 309 | * content type. |
309 | */ | |
310 | public Charset getCharset() { | |
311 | if (charset != null) { | |
312 | return charset; | |
313 | } | |
314 | ||
315 | charset = getCharsetFromContentType(getContentType()); | |
310 | * | |
311 | * @throws UnsupportedEncodingException If the user agent has specified an | |
312 | * invalid character encoding | |
313 | */ | |
314 | public Charset getCharset() throws UnsupportedEncodingException { | |
315 | if (charset == null) { | |
316 | getCharacterEncoding(); | |
317 | if (characterEncoding != null) { | |
318 | charset = B2CConverter.getCharset(characterEncoding); | |
319 | } | |
320 | } | |
316 | 321 | |
317 | 322 | return charset; |
318 | 323 | } |
333 | 338 | |
334 | 339 | public void setCharset(Charset charset) { |
335 | 340 | this.charset = charset; |
336 | } | |
341 | this.characterEncoding = charset.name(); | |
342 | } | |
343 | ||
337 | 344 | |
338 | 345 | public void setContentLength(long len) { |
339 | 346 | this.contentLength = len; |
633 | 640 | contentLength = -1; |
634 | 641 | contentTypeMB = null; |
635 | 642 | charset = null; |
643 | characterEncoding = null; | |
636 | 644 | expectation = false; |
637 | 645 | headers.recycle(); |
638 | 646 | serverNameMB.recycle(); |
693 | 701 | * |
694 | 702 | * @param contentType a content type header |
695 | 703 | */ |
696 | private static Charset getCharsetFromContentType(String contentType) { | |
704 | private static String getCharsetFromContentType(String contentType) { | |
697 | 705 | |
698 | 706 | if (contentType == null) { |
699 | 707 | return null; |
713 | 721 | encoding = encoding.substring(1, encoding.length() - 1); |
714 | 722 | } |
715 | 723 | |
716 | Charset result = null; | |
717 | ||
718 | try { | |
719 | result = B2CConverter.getCharset(encoding.trim()); | |
720 | } catch (UnsupportedEncodingException e) { | |
721 | // Ignore | |
722 | } | |
723 | ||
724 | return result; | |
725 | } | |
726 | ||
724 | return encoding.trim(); | |
725 | } | |
727 | 726 | } |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | ajpprotocol.noBio=The AJP BIO connector has been removed in Tomcat 8.5.x onwards. The AJP BIO connector configuration has been automatically switched to use the AJP NIO connector instead. |
15 | 16 | ajpprotocol.noSSL=SSL is not supported with AJP. The SSL host configuration for [{0}] was ignored |
16 | 17 | ajpprotocol.noUpgrade=Upgrade is not supported with AJP. The UpgradeProtocol configuration for [{0}] was ignored |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | ajpprotocol.proto.error = Error leyendo requerimiento, ignorado |
15 | 16 | ajpprocessor.failedread = Fallo en lectura de Conector |
16 | 17 | ajpprocessor.failedsend = No pude enviar mensaje AJP |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | http11processor.header.parse = Error analizando cabecera de requerimiento HTTP |
15 | 16 | http11processor.neverused = Este m\u00E9todo no deber\u00EDa de usarse nunca |
16 | 17 | http11processor.request.prepare = Error preparando requerimiento |
33 | 33 | public void validateHeaders() throws StreamException { |
34 | 34 | // NO-OP |
35 | 35 | } |
36 | ||
37 | @Override | |
38 | public void setHeaderException(StreamException streamException) { | |
39 | // NO-OP | |
40 | // The connection is already closing so no need to process additional | |
41 | // errors | |
42 | } | |
36 | 43 | } |
355 | 355 | void emitHeader(String name, String value) throws HpackException; |
356 | 356 | |
357 | 357 | /** |
358 | * Inform the recipient of the headers that a stream error needs to be | |
359 | * triggered using the given message when {@link #validateHeaders()} is | |
360 | * called. This is used when the Parser becomes aware of an error that | |
361 | * is not visible to the recipient. | |
362 | * | |
363 | * @param streamException The exception to use when resetting the stream | |
364 | */ | |
365 | void setHeaderException(StreamException streamException); | |
366 | ||
367 | /** | |
358 | 368 | * Are the headers pass to the recipient so far valid? The decoder needs |
359 | 369 | * to process all the headers to maintain state even if there is a |
360 | 370 | * problem. In addition, it is easy for the the intended recipient to |
44 | 44 | ByteBuffer.allocate(Constants.DEFAULT_HEADER_READ_BUFFER_SIZE); |
45 | 45 | private volatile int headersCurrentStream = -1; |
46 | 46 | private volatile boolean headersEndStream = false; |
47 | private volatile boolean streamReset = false; | |
48 | 47 | |
49 | 48 | Http2Parser(String connectionId, Input input, Output output) { |
50 | 49 | this.connectionId = connectionId; |
378 | 377 | readHeaderPayload(streamId, payloadSize); |
379 | 378 | |
380 | 379 | if (Flags.isEndOfHeaders(flags)) { |
380 | headersCurrentStream = -1; | |
381 | 381 | onHeadersComplete(streamId); |
382 | headersCurrentStream = -1; | |
383 | 382 | } |
384 | 383 | } |
385 | 384 | |
426 | 425 | headerReadBuffer.compact(); |
427 | 426 | remaining -= toRead; |
428 | 427 | |
429 | if (hpackDecoder.isHeaderCountExceeded() && !streamReset) { | |
430 | streamReset = true; | |
431 | throw new StreamException(sm.getString("http2Parser.headerLimitCount", connectionId, | |
432 | Integer.valueOf(streamId)), Http2Error.ENHANCE_YOUR_CALM, streamId); | |
433 | } | |
434 | ||
435 | if (hpackDecoder.isHeaderSizeExceeded(headerReadBuffer.position()) && !streamReset) { | |
436 | streamReset = true; | |
437 | throw new StreamException(sm.getString("http2Parser.headerLimitSize", connectionId, | |
438 | Integer.valueOf(streamId)), Http2Error.ENHANCE_YOUR_CALM, streamId); | |
428 | if (hpackDecoder.isHeaderCountExceeded()) { | |
429 | StreamException headerException = new StreamException(sm.getString( | |
430 | "http2Parser.headerLimitCount", connectionId, Integer.valueOf(streamId)), | |
431 | Http2Error.ENHANCE_YOUR_CALM, streamId); | |
432 | hpackDecoder.getHeaderEmitter().setHeaderException(headerException); | |
433 | } | |
434 | ||
435 | if (hpackDecoder.isHeaderSizeExceeded(headerReadBuffer.position())) { | |
436 | StreamException headerException = new StreamException(sm.getString( | |
437 | "http2Parser.headerLimitSize", connectionId, Integer.valueOf(streamId)), | |
438 | Http2Error.ENHANCE_YOUR_CALM, streamId); | |
439 | hpackDecoder.getHeaderEmitter().setHeaderException(headerException); | |
439 | 440 | } |
440 | 441 | |
441 | 442 | if (hpackDecoder.isHeaderSwallowSizeExceeded(headerReadBuffer.position())) { |
443 | 444 | connectionId, Integer.valueOf(streamId)), Http2Error.ENHANCE_YOUR_CALM); |
444 | 445 | } |
445 | 446 | } |
446 | ||
447 | hpackDecoder.getHeaderEmitter().validateHeaders(); | |
448 | 447 | } |
449 | 448 | |
450 | 449 | |
456 | 455 | Http2Error.COMPRESSION_ERROR); |
457 | 456 | } |
458 | 457 | |
458 | // Delay validation (and triggering any exception) until this point | |
459 | // since all the headers still have to be read if a StreamException is | |
460 | // going to be thrown. | |
461 | hpackDecoder.getHeaderEmitter().validateHeaders(); | |
462 | ||
459 | 463 | output.headersEnd(streamId); |
460 | 464 | |
461 | 465 | if (headersEndStream) { |
466 | 470 | // Reset size for new request if the buffer was previously expanded |
467 | 471 | if (headerReadBuffer.capacity() > Constants.DEFAULT_HEADER_READ_BUFFER_SIZE) { |
468 | 472 | headerReadBuffer = ByteBuffer.allocate(Constants.DEFAULT_HEADER_READ_BUFFER_SIZE); |
469 | } | |
470 | ||
471 | // Clear the 'stream has been reset' flag, if set | |
472 | if (streamReset) { | |
473 | streamReset = false; | |
474 | 473 | } |
475 | 474 | } |
476 | 475 |
60 | 60 | private final StreamStateMachine state; |
61 | 61 | // State machine would be too much overhead |
62 | 62 | private int headerState = HEADER_STATE_START; |
63 | private String headerStateErrorMsg = null; | |
63 | private StreamException headerException = null; | |
64 | 64 | // TODO: null these when finished to reduce memory used by closed stream |
65 | 65 | private final Request coyoteRequest; |
66 | 66 | private StringBuilder cookieHeader = null; |
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
262 | if (headerStateErrorMsg != null) { | |
262 | if (headerException != null) { | |
263 | 263 | // Don't bother processing the header since the stream is going to |
264 | 264 | // be reset anyway |
265 | 265 | return; |
268 | 268 | boolean pseudoHeader = name.charAt(0) == ':'; |
269 | 269 | |
270 | 270 | if (pseudoHeader && headerState != HEADER_STATE_PSEUDO) { |
271 | headerStateErrorMsg = sm.getString("stream.header.unexpectedPseudoHeader", | |
272 | getConnectionId(), getIdentifier(), name); | |
271 | headerException = new StreamException(sm.getString( | |
272 | "stream.header.unexpectedPseudoHeader", getConnectionId(), getIdentifier(), | |
273 | name), Http2Error.PROTOCOL_ERROR, getIdentifier().intValue()); | |
273 | 274 | // No need for further processing. The stream will be reset. |
274 | 275 | return; |
275 | 276 | } |
355 | 356 | coyoteRequest.setExpectation(true); |
356 | 357 | } |
357 | 358 | if (pseudoHeader) { |
358 | headerStateErrorMsg = sm.getString("stream.header.unknownPseudoHeader", | |
359 | getConnectionId(), getIdentifier(), name); | |
359 | headerException = new StreamException(sm.getString( | |
360 | "stream.header.unknownPseudoHeader", getConnectionId(), getIdentifier(), | |
361 | name), Http2Error.PROTOCOL_ERROR, getIdentifier().intValue()); | |
360 | 362 | } |
361 | 363 | // Assume other HTTP header |
362 | 364 | coyoteRequest.getMimeHeaders().addValue(name).setString(value); |
366 | 368 | |
367 | 369 | |
368 | 370 | @Override |
371 | public void setHeaderException(StreamException streamException) { | |
372 | if (headerException == null) { | |
373 | headerException = streamException; | |
374 | } | |
375 | } | |
376 | ||
377 | ||
378 | @Override | |
369 | 379 | public void validateHeaders() throws StreamException { |
370 | if (headerStateErrorMsg == null) { | |
380 | if (headerException == null) { | |
371 | 381 | return; |
372 | 382 | } |
373 | 383 | |
374 | throw new StreamException(headerStateErrorMsg, Http2Error.PROTOCOL_ERROR, | |
375 | getIdentifier().intValue()); | |
384 | throw headerException; | |
376 | 385 | } |
377 | 386 | |
378 | 387 |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | error.convert = No puedo convertir [{0}] desde tipo [{1}] a [{2}] |
15 | 16 | error.compare = No puedo comparar [{0}] con [{1}] |
16 | 17 | error.function = Problemas llamando a funci\u00F3n [{0}] |
204 | 204 | protected boolean failOnError = true; |
205 | 205 | |
206 | 206 | /** |
207 | * Should a separate process be forked to perform the compilation? | |
208 | */ | |
209 | private boolean fork = false; | |
210 | ||
211 | /** | |
207 | 212 | * The file extensions to be handled as JSP files. |
208 | 213 | * Default list is .jsp and .jspx. |
209 | 214 | */ |
781 | 786 | */ |
782 | 787 | @Override |
783 | 788 | public boolean getFork() { |
784 | return false; | |
789 | return fork; | |
790 | } | |
791 | ||
792 | public void setFork(boolean fork) { | |
793 | this.fork = fork; | |
785 | 794 | } |
786 | 795 | |
787 | 796 | /** |
388 | 388 | if (suffix == null) { |
389 | 389 | suffix = getProperty(className + ".suffix", ".log"); |
390 | 390 | } |
391 | ||
392 | // https://bz.apache.org/bugzilla/show_bug.cgi?id=61232 | |
393 | boolean shouldCheckForRedundantSeparator = !rotatable && !prefix.isEmpty() | |
394 | && !suffix.isEmpty(); | |
395 | // assuming separator is just one char, if there are use cases with | |
396 | // more, the notion of separator might be introduced | |
397 | if (shouldCheckForRedundantSeparator | |
398 | && (prefix.charAt(prefix.length() - 1) == suffix.charAt(0))) { | |
399 | suffix = suffix.substring(1); | |
400 | } | |
401 | ||
391 | 402 | pattern = Pattern.compile("^(" + Pattern.quote(prefix) + ")\\d{4}-\\d{1,2}-\\d{1,2}(" |
392 | 403 | + Pattern.quote(suffix) + ")$"); |
393 | 404 | String sMaxDays = getProperty(className + ".maxDays", String.valueOf(DEFAULT_MAX_DAYS)); |
560 | 571 | } |
561 | 572 | |
562 | 573 | private String obtainDateFromPath(Path path) { |
563 | String date = path.getFileName().toString(); | |
574 | Path fileName = path.getFileName(); | |
575 | if (fileName == null) { | |
576 | return null; | |
577 | } | |
578 | String date = fileName.toString(); | |
564 | 579 | if (pattern.matcher(date).matches()) { |
565 | 580 | date = date.substring(prefix.length()); |
566 | 581 | return date.substring(0, date.length() - suffix.length()); |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | filterDef.invalidFilterName=Invalid <filter-name> [{0}] in filter definition. |
15 | 16 | |
16 | 17 | securityConstraint.uncoveredHttpMethod=For security constraints with URL pattern [{0}] only the HTTP methods [{1}] are covered. All other methods are uncovered. |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | # | |
14 | 15 | # HttpMessages. The values in this file will be used in HTTP headers and as such |
15 | 16 | # may only contain TEXT as defined by RFC 2616 |
16 | 17 | sc.100 = Continuar |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | # | |
14 | 15 | # net resources |
15 | 16 | endpoint.err.handshake = Acuerdo fallido |
16 | 17 | endpoint.err.unexpected = Error inesperado al procesar conector |
31 | 31 | * authenticate itself to SSL clients. |
32 | 32 | * |
33 | 33 | * @author Jan Luehe |
34 | * | |
35 | * @deprecated Unused. This class will be removed in Tomcat 9. | |
34 | 36 | */ |
37 | @Deprecated | |
35 | 38 | public final class JSSEKeyManager extends X509ExtendedKeyManager { |
36 | 39 | |
37 | 40 | private X509KeyManager delegate; |
51 | 51 | import javax.net.ssl.SSLSessionContext; |
52 | 52 | import javax.net.ssl.TrustManager; |
53 | 53 | import javax.net.ssl.TrustManagerFactory; |
54 | import javax.net.ssl.X509KeyManager; | |
55 | 54 | |
56 | 55 | import org.apache.juli.logging.Log; |
57 | 56 | import org.apache.juli.logging.LogFactory; |
170 | 169 | |
171 | 170 | @Override |
172 | 171 | public KeyManager[] getKeyManagers() throws Exception { |
173 | String keystoreType = certificate.getCertificateKeystoreType(); | |
174 | 172 | String keyAlias = certificate.getCertificateKeyAlias(); |
175 | 173 | String algorithm = sslHostConfig.getKeyManagerAlgorithm(); |
176 | 174 | String keyPass = certificate.getCertificateKeyPassword(); |
180 | 178 | keyPass = certificate.getCertificateKeystorePassword(); |
181 | 179 | } |
182 | 180 | |
183 | KeyManager[] kms = null; | |
184 | ||
185 | 181 | KeyStore ks = certificate.getCertificateKeystore(); |
186 | 182 | |
183 | /* | |
184 | * Always use an in memory key store. | |
185 | * For PEM format keys and certificates, it allows them to be imported | |
186 | * into the expected format. | |
187 | * For Java key stores, it enables Tomcat to handle the case where | |
188 | * multiple keys exist in the key store, each with a different password. | |
189 | * The KeyManagerFactory can't handle that so using an in memory key | |
190 | * store with just the required key works around that. | |
191 | */ | |
192 | KeyStore inMemoryKeyStore = KeyStore.getInstance("JKS"); | |
193 | inMemoryKeyStore.load(null, null); | |
194 | ||
195 | char[] keyPassArray = keyPass.toCharArray(); | |
196 | ||
187 | 197 | if (ks == null) { |
188 | // create an in-memory keystore and import the private key | |
189 | // and the certificate chain from the PEM files | |
190 | ks = KeyStore.getInstance("JKS"); | |
191 | ks.load(null, null); | |
192 | ||
193 | 198 | PEMFile privateKeyFile = new PEMFile(SSLHostConfig.adjustRelativePath |
194 | 199 | (certificate.getCertificateKeyFile() != null ? certificate.getCertificateKeyFile() : certificate.getCertificateFile()), |
195 | 200 | keyPass); |
205 | 210 | if (keyAlias == null) { |
206 | 211 | keyAlias = "tomcat"; |
207 | 212 | } |
208 | ks.setKeyEntry(keyAlias, privateKeyFile.getPrivateKey(), keyPass.toCharArray(), chain.toArray(new Certificate[chain.size()])); | |
209 | } | |
210 | ||
211 | if (keyAlias != null && !ks.isKeyEntry(keyAlias)) { | |
212 | throw new IOException(sm.getString("jsse.alias_no_key_entry", keyAlias)); | |
213 | } | |
213 | inMemoryKeyStore.setKeyEntry(keyAlias, privateKeyFile.getPrivateKey(), keyPass.toCharArray(), chain.toArray(new Certificate[chain.size()])); | |
214 | } else { | |
215 | if (keyAlias != null && !ks.isKeyEntry(keyAlias)) { | |
216 | throw new IOException(sm.getString("jsse.alias_no_key_entry", keyAlias)); | |
217 | } else if (keyAlias == null) { | |
218 | Enumeration<String> aliases = ks.aliases(); | |
219 | if (!aliases.hasMoreElements()) { | |
220 | throw new IOException(sm.getString("jsse.noKeys")); | |
221 | } | |
222 | keyAlias = aliases.nextElement(); | |
223 | } | |
224 | ||
225 | inMemoryKeyStore.setKeyEntry(keyAlias, ks.getKey(keyAlias, keyPassArray), keyPassArray, | |
226 | ks.getCertificateChain(keyAlias)); | |
227 | } | |
228 | ||
214 | 229 | |
215 | 230 | KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm); |
216 | kmf.init(ks, keyPass.toCharArray()); | |
217 | ||
218 | kms = kmf.getKeyManagers(); | |
219 | if (kms == null) { | |
220 | return kms; | |
221 | } | |
222 | ||
223 | if (keyAlias != null) { | |
224 | String alias = keyAlias; | |
225 | // JKS keystores always convert the alias name to lower case | |
226 | if ("JKS".equals(keystoreType)) { | |
227 | alias = alias.toLowerCase(Locale.ENGLISH); | |
228 | } | |
229 | for(int i = 0; i < kms.length; i++) { | |
230 | kms[i] = new JSSEKeyManager((X509KeyManager)kms[i], alias); | |
231 | } | |
232 | } | |
233 | ||
234 | return kms; | |
231 | kmf.init(inMemoryKeyStore, keyPassArray); | |
232 | ||
233 | return kmf.getKeyManagers(); | |
235 | 234 | } |
236 | 235 | |
237 | 236 |
21 | 21 | jsse.excludeProtocol=The SSL protocol [{0}] which is supported in this JRE was excluded from the protocols available to Tomcat |
22 | 22 | jsse.noDefaultCiphers=Unable to determine a default for ciphers for [{0}]. Set an explicit value to ensure the connector can start. |
23 | 23 | jsse.noDefaultProtocols=Unable to determine a default for sslEnabledProtocols. Set an explicit value to ensure the connector can start. |
24 | jsse.noKeys=No aliases for private keys found in key store | |
24 | 25 | jsse.exceptionOnClose=Failure to close socket. |
25 | 26 | jsse.pemParseError=Unable to parse the key from [{0}] |
26 | 27 |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | jsse.alias_no_key_entry = El nombre de Alias [{0}] no identifica una entrada de clave |
15 | 16 | jsse.invalid_ssl_conf = La configuraci\u00F3n SSL no es v\u00E1lida debido a [{0}] |
16 | 17 | jsse.invalidTrustManagerClassName = El trustManagerClassName suministrado [{0}] no implementa javax.net.ssl.TrustManager |
49 | 49 | import org.apache.tomcat.util.net.SSLHostConfig; |
50 | 50 | import org.apache.tomcat.util.net.SSLHostConfigCertificate; |
51 | 51 | import org.apache.tomcat.util.net.SSLHostConfigCertificate.Type; |
52 | import org.apache.tomcat.util.net.jsse.JSSEKeyManager; | |
53 | 52 | import org.apache.tomcat.util.net.openssl.ciphers.OpenSSLCipherConfigurationParser; |
54 | 53 | import org.apache.tomcat.util.res.StringManager; |
55 | 54 | |
373 | 372 | |
374 | 373 | private static X509KeyManager chooseKeyManager(KeyManager[] managers) throws Exception { |
375 | 374 | for (KeyManager manager : managers) { |
376 | if (manager instanceof JSSEKeyManager) { | |
377 | return (JSSEKeyManager) manager; | |
378 | } | |
379 | } | |
380 | for (KeyManager manager : managers) { | |
381 | 375 | if (manager instanceof X509KeyManager) { |
382 | 376 | return (X509KeyManager) manager; |
383 | 377 | } |
676 | 676 | } |
677 | 677 | |
678 | 678 | @Override |
679 | public String[] getEnabledCipherSuites() { | |
679 | public synchronized String[] getEnabledCipherSuites() { | |
680 | if (destroyed) { | |
681 | return new String[0]; | |
682 | } | |
680 | 683 | String[] enabled = SSL.getCiphers(ssl); |
681 | 684 | if (enabled == null) { |
682 | 685 | return new String[0]; |
692 | 695 | } |
693 | 696 | |
694 | 697 | @Override |
695 | public void setEnabledCipherSuites(String[] cipherSuites) { | |
698 | public synchronized void setEnabledCipherSuites(String[] cipherSuites) { | |
696 | 699 | if (cipherSuites == null) { |
697 | 700 | throw new IllegalArgumentException(sm.getString("engine.nullCipherSuite")); |
701 | } | |
702 | if (destroyed) { | |
703 | return; | |
698 | 704 | } |
699 | 705 | final StringBuilder buf = new StringBuilder(); |
700 | 706 | for (String cipherSuite : cipherSuites) { |
732 | 738 | } |
733 | 739 | |
734 | 740 | @Override |
735 | public String[] getEnabledProtocols() { | |
741 | public synchronized String[] getEnabledProtocols() { | |
742 | if (destroyed) { | |
743 | return new String[0]; | |
744 | } | |
736 | 745 | List<String> enabled = new ArrayList<>(); |
737 | 746 | // Seems like there is no way to explicitly disable SSLv2Hello in OpenSSL so it is always enabled |
738 | 747 | enabled.add(Constants.SSL_PROTO_SSLv2Hello); |
761 | 770 | } |
762 | 771 | |
763 | 772 | @Override |
764 | public void setEnabledProtocols(String[] protocols) { | |
773 | public synchronized void setEnabledProtocols(String[] protocols) { | |
765 | 774 | if (protocols == null) { |
766 | 775 | // This is correct from the API docs |
767 | 776 | throw new IllegalArgumentException(); |
777 | } | |
778 | if (destroyed) { | |
779 | return; | |
768 | 780 | } |
769 | 781 | boolean sslv2 = false; |
770 | 782 | boolean sslv3 = false; |
1251 | 1263 | |
1252 | 1264 | @Override |
1253 | 1265 | public String getCipherSuite() { |
1254 | if (!handshakeFinished) { | |
1255 | return INVALID_CIPHER; | |
1256 | } | |
1257 | 1266 | if (cipher == null) { |
1258 | 1267 | String ciphers; |
1259 | 1268 | synchronized (OpenSSLEngine.this) { |
1269 | if (!handshakeFinished) { | |
1270 | return INVALID_CIPHER; | |
1271 | } | |
1260 | 1272 | if (destroyed) { |
1261 | 1273 | return INVALID_CIPHER; |
1262 | 1274 | } |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | threadPoolExecutor.threadStoppedToAvoidPotentialLeak = Parando hilo [{0}] para evita fallos potenciales de memoria tras haberse parado un contexto. |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | serverContainer.addNotAllowed=No further Endpoints may be registered once an attempt has been made to use one of the previously registered endpoints |
15 | 16 | serverContainer.configuratorFail=Failed to create configurator of type [{0}] for POJO of type [{1}] |
16 | 17 | serverContainer.duplicatePaths=Multiple Endpoints may not be deployed to the same path [{0}] : existing endpoint was [{1}] and new endpoint is [{2}] |
30 | 30 | <module name="RegexpHeader"> |
31 | 31 | <property name="headerFile" value="${basedir}/res/checkstyle/header-al2.txt"/> |
32 | 32 | <property name="multiLines" value="1, 2, 3, 4"/> |
33 | <property name="fileExtensions" value="java,xml,jsp,txt,sh,bat"/> | |
33 | <property name="fileExtensions" value="java,xml,jsp,txt,sh,bat,properties"/> | |
34 | 34 | </module> |
35 | 35 | |
36 | 36 | <!-- Whitespace --> |
38 | 38 | maven.asf.release.repo.repositoryId=apache.releases.https |
39 | 39 | |
40 | 40 | # Release version info |
41 | maven.asf.release.deploy.version=8.5.17 | |
41 | maven.asf.release.deploy.version=8.5.18 | |
42 | 42 | |
43 | 43 | #Where do we load the libraries from |
44 | 44 | tomcat.lib.path=../../output/build/lib |
42 | 42 | !include "StrFunc.nsh" |
43 | 43 | !include "LogicLib.nsh" |
44 | 44 | !include "FileFunc.nsh" |
45 | !include "TextFunc.nsh" | |
45 | 46 | ${StrRep} |
46 | 47 | |
47 | 48 | Var JavaHome |
358 | 359 | |
359 | 360 | SectionEnd |
360 | 361 | |
362 | !define ReadFromConfigIni "!insertmacro ReadFromConfigIni" | |
363 | !macro ReadFromConfigIni Return_Variable Key_Name Config_File | |
364 | Push "${Config_File}" | |
365 | Push "${Return_Variable}" | |
366 | Push "${Key_Name}" | |
367 | Call ReadFromConfigIni | |
368 | IfErrors +2 | |
369 | StrCpy ${Return_Variable} $1 | |
370 | !macroend | |
371 | ||
372 | Function ReadFromConfigIni | |
373 | ClearErrors | |
374 | ; Stack: <Key_Name> <Return_Variable> <Config_File> | |
375 | Pop $0 ; <Key_Name> Stack: <Return_Variable> <Config_File> | |
376 | Pop $1 ; <Return_Variable> Stack: <Config_File> | |
377 | Pop $2 ; <Config_File> Stack: -empty- | |
378 | ||
379 | ${ConfigRead} $2 '$0=' $1 ; <Config_File> <Key_Name> <Return_Variable> | |
380 | FunctionEnd | |
381 | ||
361 | 382 | Function .onInit |
362 | 383 | !ifdef UNINSTALLONLY |
363 | 384 | ; If UNINSTALLONLY is defined, then we aren't supposed to do anything except write out |
374 | 395 | ${IfNot} ${Errors} |
375 | 396 | MessageBox MB_OK|MB_ICONINFORMATION 'Available options:$\r$\n\ |
376 | 397 | /S - Silent install.$\r$\n\ |
398 | /C=config.ini - specify full path of config file to override default values.$\r$\n\ | |
377 | 399 | /D=INSTDIR - Specify installation directory.' |
378 | 400 | Abort |
379 | 401 | ${EndIf} |
396 | 418 | StrCpy $TomcatAdminUsername "" |
397 | 419 | StrCpy $TomcatAdminPassword "" |
398 | 420 | StrCpy $TomcatAdminRoles "" |
421 | ||
422 | ;override default values in case config file was passed in | |
423 | ${GetOptions} "$R0" "/C=" $R2 | |
424 | ${IfNot} ${Errors} | |
425 | ${ReadFromConfigIni} $JavaHome "JavaHome" $R2 | |
426 | ${ReadFromConfigIni} $TomcatPortShutdown "TomcatPortShutdown" $R2 | |
427 | ${ReadFromConfigIni} $TomcatPortHttp "TomcatPortHttp" $R2 | |
428 | ${ReadFromConfigIni} $TomcatPortAjp "TomcatPortAjp" $R2 | |
429 | ${ReadFromConfigIni} $TomcatMenuEntriesEnable "TomcatMenuEntriesEnable" $R2 | |
430 | ${ReadFromConfigIni} $TomcatShortcutAllUsers "TomcatShortcutAllUsers" $R2 | |
431 | ${ReadFromConfigIni} $TomcatServiceDefaultName "TomcatServiceDefaultName" $R2 | |
432 | ${ReadFromConfigIni} $TomcatServiceName "TomcatServiceName" $R2 | |
433 | ${ReadFromConfigIni} $TomcatServiceFileName "TomcatServiceFileName" $R2 | |
434 | ${ReadFromConfigIni} $TomcatServiceManagerFileName "TomcatServiceManagerFileName" $R2 | |
435 | ${ReadFromConfigIni} $TomcatAdminEnable "TomcatAdminEnable" $R2 | |
436 | ${ReadFromConfigIni} $TomcatAdminUsername "TomcatAdminUsername" $R2 | |
437 | ${ReadFromConfigIni} $TomcatAdminPassword "TomcatAdminPassword" $R2 | |
438 | ${ReadFromConfigIni} $TomcatAdminRoles "TomcatAdminRoles" $R2 | |
439 | ${EndIf} | |
440 | ClearErrors | |
441 | ||
399 | 442 | FunctionEnd |
400 | 443 | |
401 | 444 | Function pageChooseJVM |
879 | 922 | IfFileExists "$2" FoundJvmDll |
880 | 923 | |
881 | 924 | ClearErrors |
882 | ;Step tree: Read defaults from registry | |
925 | ;Step three: Read defaults from registry | |
883 | 926 | |
884 | 927 | ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" |
885 | 928 | ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "RuntimeLib" |
24 | 24 | import java.net.HttpURLConnection; |
25 | 25 | import java.net.URL; |
26 | 26 | import java.util.ArrayList; |
27 | import java.util.Arrays; | |
27 | 28 | import java.util.Enumeration; |
29 | import java.util.HashMap; | |
28 | 30 | import java.util.List; |
29 | 31 | import java.util.Locale; |
32 | import java.util.Map; | |
30 | 33 | import java.util.TreeMap; |
31 | 34 | |
32 | 35 | import javax.servlet.ServletException; |
902 | 905 | |
903 | 906 | System.out.println(time); |
904 | 907 | } |
908 | ||
909 | ||
910 | @Test | |
911 | public void testGetReaderValidEncoding() throws Exception { | |
912 | doTestGetReader("ISO-8859-1", true); | |
913 | } | |
914 | ||
915 | ||
916 | @Test | |
917 | public void testGetReaderInvalidEbcoding() throws Exception { | |
918 | doTestGetReader("X-Invalid", false); | |
919 | } | |
920 | ||
921 | ||
922 | private void doTestGetReader(String userAgentCharaceterEncoding, boolean expect200) | |
923 | throws Exception { | |
924 | ||
925 | // Setup Tomcat instance | |
926 | Tomcat tomcat = getTomcatInstance(); | |
927 | ||
928 | // No file system docBase required | |
929 | Context ctx = tomcat.addContext("", null); | |
930 | ||
931 | Tomcat.addServlet(ctx, "servlet", new Bug61264GetReaderServlet()); | |
932 | ctx.addServletMappingDecoded("/", "servlet"); | |
933 | ||
934 | tomcat.start(); | |
935 | ||
936 | byte[] body = "Test".getBytes(); | |
937 | ByteChunk bc = new ByteChunk(); | |
938 | Map<String,List<String>> reqHeaders = new HashMap<>(); | |
939 | reqHeaders.put("Content-Type", | |
940 | Arrays.asList(new String[] {"text/plain;charset=" + userAgentCharaceterEncoding})); | |
941 | ||
942 | int rc = postUrl(body, "http://localhost:" + getPort() + "/", bc, reqHeaders, null); | |
943 | ||
944 | if (expect200) { | |
945 | assertEquals(200, rc); | |
946 | } else { | |
947 | assertEquals(500, rc); | |
948 | } | |
949 | } | |
950 | ||
951 | ||
952 | private class Bug61264GetReaderServlet extends HttpServlet { | |
953 | ||
954 | private static final long serialVersionUID = 1L; | |
955 | ||
956 | @Override | |
957 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) | |
958 | throws ServletException, IOException { | |
959 | // This is intended for POST requests | |
960 | resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); | |
961 | } | |
962 | ||
963 | @Override | |
964 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) | |
965 | throws ServletException, IOException { | |
966 | // Container will handle any errors | |
967 | req.getReader(); | |
968 | } | |
969 | } | |
905 | 970 | } |
2601 | 2601 | } |
2602 | 2602 | |
2603 | 2603 | |
2604 | @Override | |
2604 | 2605 | @Before |
2605 | public void setup() { | |
2606 | public void setUp() throws Exception { | |
2607 | super.setUp(); | |
2606 | 2608 | // Required by testBug61185() |
2607 | 2609 | // Does not impact other tests in this class |
2608 | 2610 | System.setProperty("org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH", "true"); |
53 | 53 | import org.apache.catalina.startup.TomcatBaseTest; |
54 | 54 | import org.apache.tomcat.util.buf.B2CConverter; |
55 | 55 | import org.apache.tomcat.util.buf.ByteChunk; |
56 | import org.apache.tomcat.util.descriptor.web.ErrorPage; | |
56 | 57 | import org.apache.tomcat.util.http.parser.MediaType; |
57 | 58 | import org.apache.tomcat.websocket.server.WsContextListener; |
58 | 59 | |
119 | 120 | Wrapper defaultServlet = Tomcat.addServlet(ctxt, "default", |
120 | 121 | "org.apache.catalina.servlets.DefaultServlet"); |
121 | 122 | defaultServlet.addInitParameter("gzip", "true"); |
123 | defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1"); | |
122 | 124 | ctxt.addServletMappingDecoded("/", "default"); |
123 | 125 | |
124 | 126 | ctxt.addMimeMapping("html", "text/html"); |
174 | 176 | Wrapper defaultServlet = Tomcat.addServlet(ctxt, "default", |
175 | 177 | "org.apache.catalina.servlets.DefaultServlet"); |
176 | 178 | defaultServlet.addInitParameter("precompressed", "true"); |
179 | defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1"); | |
177 | 180 | |
178 | 181 | ctxt.addServletMappingDecoded("/", "default"); |
179 | 182 | ctxt.addMimeMapping("html", "text/html"); |
284 | 287 | Wrapper defaultServlet = Tomcat.addServlet(ctxt, "default", |
285 | 288 | DefaultServlet.class.getName()); |
286 | 289 | defaultServlet.addInitParameter("precompressed", "br=.br,gzip=.gz"); |
290 | defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1"); | |
287 | 291 | |
288 | 292 | ctxt.addServletMappingDecoded("/", "default"); |
289 | 293 | ctxt.addMimeMapping("html", "text/html"); |
454 | 458 | */ |
455 | 459 | @Test |
456 | 460 | public void testCustomErrorPage() throws Exception { |
457 | File appDir = new File(getTemporaryDirectory(), "MyApp"); | |
458 | File webInf = new File(appDir, "WEB-INF"); | |
459 | addDeleteOnTearDown(appDir); | |
460 | if (!webInf.mkdirs() && !webInf.isDirectory()) { | |
461 | fail("Unable to create directory [" + webInf + "]"); | |
462 | } | |
463 | ||
464 | File webxml = new File(appDir, "WEB-INF/web.xml"); | |
465 | try (FileOutputStream fos = new FileOutputStream(webxml); | |
466 | Writer w = new OutputStreamWriter(fos, "UTF-8");) { | |
467 | w.write("<?xml version='1.0' encoding='UTF-8'?>\n" | |
468 | + "<web-app xmlns='http://java.sun.com/xml/ns/j2ee' " | |
469 | + " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" | |
470 | + " xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee " | |
471 | + " http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd'" | |
472 | + " version='2.4'>\n" | |
473 | + "<error-page>\n<error-code>404</error-code>\n" | |
474 | + "<location>/404.html</location>\n</error-page>\n" | |
475 | + "</web-app>\n"); | |
476 | } | |
477 | ||
478 | File error404 = new File(appDir, "404.html"); | |
479 | try (FileOutputStream fos = new FileOutputStream(error404); | |
480 | Writer w = new OutputStreamWriter(fos, "ISO-8859-1")) { | |
481 | w.write("It is 404.html"); | |
482 | } | |
483 | ||
484 | Tomcat tomcat = getTomcatInstance(); | |
485 | String contextPath = "/MyApp"; | |
486 | tomcat.addWebapp(null, contextPath, appDir.getAbsolutePath()); | |
461 | ||
462 | Tomcat tomcat = getTomcatInstance(); | |
463 | ||
464 | File appDir = new File("test/webapp"); | |
465 | ||
466 | // app dir is relative to server home | |
467 | Context ctxt = tomcat.addContext("", appDir.getAbsolutePath()); | |
468 | Wrapper defaultServlet = Tomcat.addServlet(ctxt, "default", | |
469 | DefaultServlet.class.getName()); | |
470 | defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1"); | |
471 | ||
472 | ctxt.addServletMappingDecoded("/", "default"); | |
473 | ctxt.addMimeMapping("html", "text/html"); | |
474 | ErrorPage ep = new ErrorPage(); | |
475 | ep.setErrorCode(404); | |
476 | ep.setLocation("/404.html"); | |
477 | ctxt.addErrorPage(ep); | |
478 | ||
487 | 479 | tomcat.start(); |
488 | 480 | |
489 | 481 | TestCustomErrorClient client = |
21 | 21 | import java.io.InputStream; |
22 | 22 | import java.io.OutputStream; |
23 | 23 | import java.net.Socket; |
24 | import java.net.SocketException; | |
24 | 25 | import java.nio.ByteBuffer; |
25 | 26 | import java.nio.charset.StandardCharsets; |
26 | 27 | import java.util.ArrayList; |
35 | 36 | import javax.servlet.http.HttpServletResponse; |
36 | 37 | |
37 | 38 | import org.junit.Assert; |
39 | import org.junit.Assume; | |
38 | 40 | |
39 | 41 | import org.apache.catalina.Context; |
40 | 42 | import org.apache.catalina.LifecycleException; |
804 | 806 | } |
805 | 807 | |
806 | 808 | |
809 | void handleGoAwayResponse(int lastStream) throws Http2Exception, IOException { | |
810 | handleGoAwayResponse(lastStream, Http2Error.PROTOCOL_ERROR); | |
811 | } | |
812 | ||
813 | ||
814 | void handleGoAwayResponse(int lastStream, Http2Error expectedError) | |
815 | throws Http2Exception, IOException { | |
816 | try { | |
817 | parser.readFrame(true); | |
818 | ||
819 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
820 | "0-Goaway-[" + lastStream + "]-[" + expectedError.getCode() + "]-[")); | |
821 | } catch (SocketException se) { | |
822 | // On some platform / Connector combinations (e.g. Windows / NIO2), | |
823 | // the TCP connection close will be processed before the client gets | |
824 | // a chance to read the connection close frame. | |
825 | Tomcat tomcat = getTomcatInstance(); | |
826 | Connector connector = tomcat.getConnector(); | |
827 | ||
828 | Assume.assumeTrue("This test is only expected to trigger an exception with NIO2", | |
829 | connector.getProtocolHandlerClassName().contains("Nio2")); | |
830 | ||
831 | Assume.assumeTrue("This test is only expected to trigger an exception on Windo9ws", | |
832 | System.getProperty("os.name").startsWith("Windows")); | |
833 | } | |
834 | } | |
835 | ||
836 | ||
807 | 837 | private static class TestInput implements Http2Parser.Input { |
808 | 838 | |
809 | 839 | private final InputStream is; |
946 | 976 | |
947 | 977 | |
948 | 978 | @Override |
979 | public void setHeaderException(StreamException streamException) { | |
980 | // NO-OP: Accept anything the server sends for the unit tests | |
981 | } | |
982 | ||
983 | ||
984 | @Override | |
949 | 985 | public void headersEnd(int streamId) { |
950 | 986 | trace.append(streamId + "-HeadersEnd\n"); |
951 | 987 | } |
79 | 79 | headers.setValue(name).setString(value); |
80 | 80 | } |
81 | 81 | @Override |
82 | public void setHeaderException(StreamException streamException) { | |
83 | // NO-OP | |
84 | } | |
85 | @Override | |
82 | 86 | public void validateHeaders() throws StreamException { |
83 | 87 | // NO-OP |
84 | 88 | } |
16 | 16 | package org.apache.coyote.http2; |
17 | 17 | |
18 | 18 | import java.io.IOException; |
19 | import java.net.SocketException; | |
19 | 20 | import java.nio.ByteBuffer; |
20 | 21 | import java.util.ArrayList; |
21 | 22 | import java.util.List; |
22 | 23 | import java.util.Random; |
23 | 24 | |
25 | import org.hamcrest.Description; | |
26 | import org.hamcrest.TypeSafeMatcher; | |
27 | ||
24 | 28 | import org.junit.Assert; |
25 | 29 | import org.junit.Test; |
26 | 30 | |
33 | 37 | @Test |
34 | 38 | public void testHeaderLimits1x128() throws Exception { |
35 | 39 | // Well within limits |
36 | doTestHeaderLimits(1, 128, 0); | |
40 | doTestHeaderLimits(1, 128, FailureMode.NONE); | |
37 | 41 | } |
38 | 42 | |
39 | 43 | |
41 | 45 | public void testHeaderLimits100x32() throws Exception { |
42 | 46 | // Just within default maxHeaderCount |
43 | 47 | // Note request has 4 standard headers |
44 | doTestHeaderLimits(96, 32, 0); | |
48 | doTestHeaderLimits(96, 32, FailureMode.NONE); | |
45 | 49 | } |
46 | 50 | |
47 | 51 | |
48 | 52 | @Test |
49 | 53 | public void testHeaderLimits101x32() throws Exception { |
50 | 54 | // Just above default maxHeaderCount |
51 | doTestHeaderLimits(97, 32, 1); | |
55 | doTestHeaderLimits(97, 32, FailureMode.STREAM_RESET); | |
52 | 56 | } |
53 | 57 | |
54 | 58 | |
55 | 59 | @Test |
56 | 60 | public void testHeaderLimits20x32WithLimit10() throws Exception { |
57 | 61 | // Check lower count limit is enforced |
58 | doTestHeaderLimits(20, 32, -1, 10, Constants.DEFAULT_MAX_HEADER_SIZE, 0, 1); | |
62 | doTestHeaderLimits(20, 32, -1, 10, Constants.DEFAULT_MAX_HEADER_SIZE, 0, | |
63 | FailureMode.STREAM_RESET); | |
59 | 64 | } |
60 | 65 | |
61 | 66 | |
63 | 68 | public void testHeaderLimits8x1144() throws Exception { |
64 | 69 | // Just within default maxHttpHeaderSize |
65 | 70 | // per header overhead plus standard 3 headers |
66 | doTestHeaderLimits(7, 1144, 0); | |
71 | doTestHeaderLimits(7, 1144, FailureMode.NONE); | |
67 | 72 | } |
68 | 73 | |
69 | 74 | |
70 | 75 | @Test |
71 | 76 | public void testHeaderLimits8x1145() throws Exception { |
72 | 77 | // Just above default maxHttpHeaderSize |
73 | doTestHeaderLimits(7, 1145, 1); | |
78 | doTestHeaderLimits(7, 1145, FailureMode.STREAM_RESET); | |
74 | 79 | } |
75 | 80 | |
76 | 81 | |
77 | 82 | @Test |
78 | 83 | public void testHeaderLimits3x1024WithLimit2048() throws Exception { |
79 | 84 | // Check lower size limit is enforced |
80 | doTestHeaderLimits(3, 1024, -1, Constants.DEFAULT_MAX_HEADER_COUNT, 2 * 1024, 0, 1); | |
85 | doTestHeaderLimits(3, 1024, -1, Constants.DEFAULT_MAX_HEADER_COUNT, 2 * 1024, 0, | |
86 | FailureMode.STREAM_RESET); | |
81 | 87 | } |
82 | 88 | |
83 | 89 | |
84 | 90 | @Test |
85 | 91 | public void testHeaderLimits1x12k() throws Exception { |
86 | 92 | // Bug 60232 |
87 | doTestHeaderLimits(1, 12*1024, 1); | |
93 | doTestHeaderLimits(1, 12*1024, FailureMode.STREAM_RESET); | |
88 | 94 | } |
89 | 95 | |
90 | 96 | |
91 | 97 | @Test |
92 | 98 | public void testHeaderLimits1x12kin1kChunks() throws Exception { |
93 | 99 | // Bug 60232 |
94 | doTestHeaderLimits(1, 12*1024, 1024, 1); | |
100 | doTestHeaderLimits(1, 12*1024, 1024, FailureMode.STREAM_RESET); | |
95 | 101 | } |
96 | 102 | |
97 | 103 | |
98 | 104 | @Test |
99 | 105 | public void testHeaderLimits1x12kin1kChunksThenNewRequest() throws Exception { |
100 | 106 | // Bug 60232 |
101 | doTestHeaderLimits(1, 12*1024, 1024, 1); | |
107 | doTestHeaderLimits(1, 12*1024, 1024, FailureMode.STREAM_RESET); | |
108 | ||
102 | 109 | |
103 | 110 | output.clearTrace(); |
104 | 111 | sendSimpleGetRequest(5); |
111 | 118 | @Test |
112 | 119 | public void testHeaderLimits1x32k() throws Exception { |
113 | 120 | // Bug 60232 |
114 | doTestHeaderLimits(1, 32*1024, 1); | |
121 | doTestHeaderLimits(1, 32*1024, FailureMode.CONNECTION_RESET); | |
115 | 122 | } |
116 | 123 | |
117 | 124 | |
121 | 128 | // 500ms per frame write delay to give server a chance to process the |
122 | 129 | // stream reset and the connection reset before the request is fully |
123 | 130 | // sent. |
124 | doTestHeaderLimits(1, 32*1024, 1024, 500, 2); | |
131 | doTestHeaderLimits(1, 32*1024, 1024, 500, FailureMode.CONNECTION_RESET); | |
125 | 132 | } |
126 | 133 | |
127 | 134 | |
128 | 135 | @Test |
129 | 136 | public void testHeaderLimits1x128k() throws Exception { |
130 | 137 | // Bug 60232 |
131 | doTestHeaderLimits(1, 128*1024, 2); | |
138 | doTestHeaderLimits(1, 128*1024, FailureMode.CONNECTION_RESET); | |
132 | 139 | } |
133 | 140 | |
134 | 141 | |
135 | 142 | @Test |
136 | 143 | public void testHeaderLimits1x512k() throws Exception { |
137 | 144 | // Bug 60232 |
138 | doTestHeaderLimits(1, 512*1024, 2); | |
145 | doTestHeaderLimits(1, 512*1024, FailureMode.CONNECTION_RESET); | |
139 | 146 | } |
140 | 147 | |
141 | 148 | |
142 | 149 | @Test |
143 | 150 | public void testHeaderLimits10x512k() throws Exception { |
144 | 151 | // Bug 60232 |
145 | doTestHeaderLimits(10, 512*1024, 2); | |
146 | } | |
147 | ||
148 | ||
149 | private void doTestHeaderLimits(int headerCount, int headerSize, int failMode) throws Exception { | |
152 | doTestHeaderLimits(10, 512*1024, FailureMode.CONNECTION_RESET); | |
153 | } | |
154 | ||
155 | ||
156 | private void doTestHeaderLimits(int headerCount, int headerSize, FailureMode failMode) | |
157 | throws Exception { | |
150 | 158 | doTestHeaderLimits(headerCount, headerSize, -1, failMode); |
151 | 159 | } |
152 | 160 | |
153 | 161 | |
154 | 162 | private void doTestHeaderLimits(int headerCount, int headerSize, int maxHeaderPayloadSize, |
155 | int failMode) throws Exception { | |
163 | FailureMode failMode) throws Exception { | |
156 | 164 | doTestHeaderLimits(headerCount, headerSize, maxHeaderPayloadSize, 0, failMode); |
157 | 165 | } |
158 | 166 | |
159 | 167 | |
160 | 168 | private void doTestHeaderLimits(int headerCount, int headerSize, int maxHeaderPayloadSize, |
161 | int delayms, int failMode) throws Exception { | |
169 | int delayms, FailureMode failMode) throws Exception { | |
162 | 170 | doTestHeaderLimits(headerCount, headerSize, maxHeaderPayloadSize, |
163 | 171 | Constants.DEFAULT_MAX_HEADER_COUNT, Constants.DEFAULT_MAX_HEADER_SIZE, delayms, |
164 | 172 | failMode); |
166 | 174 | |
167 | 175 | |
168 | 176 | private void doTestHeaderLimits(int headerCount, int headerSize, int maxHeaderPayloadSize, |
169 | int maxHeaderCount, int maxHeaderSize, int delayms, int failMode) throws Exception { | |
177 | int maxHeaderCount, int maxHeaderSize, int delayms, FailureMode failMode) | |
178 | throws Exception { | |
170 | 179 | |
171 | 180 | // Build the custom headers |
172 | 181 | List<String[]> customHeaders = new ArrayList<>(); |
225 | 234 | } |
226 | 235 | |
227 | 236 | switch (failMode) { |
228 | case 0: { | |
237 | case NONE: { | |
229 | 238 | // Expect a normal response |
230 | 239 | readSimpleGetResponse(); |
231 | 240 | Assert.assertEquals(getSimpleResponseTrace(3), output.getTrace()); |
232 | 241 | Assert.assertNull(e); |
233 | 242 | break; |
234 | 243 | } |
235 | case 1: { | |
244 | case STREAM_RESET: { | |
236 | 245 | // Expect a stream reset |
237 | 246 | parser.readFrame(true); |
238 | 247 | Assert.assertEquals("3-RST-[11]\n", output.getTrace()); |
239 | 248 | Assert.assertNull(e); |
240 | 249 | break; |
241 | 250 | } |
242 | case 2: { | |
243 | // Behaviour depends on timing. If reset is processed fast enough, | |
244 | // frames will be swallowed before the connection reset limit is | |
245 | // reached | |
246 | if (e == null) { | |
251 | case CONNECTION_RESET: { | |
252 | // Connection reset. Connection ID will vary so use a pattern | |
253 | // On some platform / Connector combinations (e.g. Windows / APR), | |
254 | // the TCP connection close will be processed before the client gets | |
255 | // a chance to read the connection close frame | |
256 | try { | |
247 | 257 | parser.readFrame(true); |
248 | Assert.assertEquals("3-RST-[11]\n", output.getTrace()); | |
249 | Assert.assertNull(e); | |
258 | Assert.assertThat(output.getTrace(), RegexMatcher.matchesRegex( | |
259 | "0-Goaway-\\[1\\]-\\[11\\]-\\[Connection \\[\\d++\\], Stream \\[3\\], .*")); | |
260 | } catch (SocketException se) { | |
261 | // Expected on Windows | |
250 | 262 | } |
251 | // Else is non-null as expected for a connection reset | |
252 | break; | |
253 | } | |
254 | default: { | |
255 | Assert.fail("Unknown failure mode"); | |
263 | break; | |
256 | 264 | } |
257 | 265 | } |
258 | 266 | } |
399 | 407 | @Test |
400 | 408 | public void doTestPostWithTrailerHeadersDefaultLimit() throws Exception{ |
401 | 409 | doTestPostWithTrailerHeaders(Constants.DEFAULT_MAX_TRAILER_COUNT, |
402 | Constants.DEFAULT_MAX_TRAILER_SIZE, true); | |
410 | Constants.DEFAULT_MAX_TRAILER_SIZE, FailureMode.NONE); | |
403 | 411 | } |
404 | 412 | |
405 | 413 | |
406 | 414 | @Test |
407 | 415 | public void doTestPostWithTrailerHeadersCount0() throws Exception{ |
408 | doTestPostWithTrailerHeaders(0, Constants.DEFAULT_MAX_TRAILER_SIZE, false); | |
416 | doTestPostWithTrailerHeaders(0, Constants.DEFAULT_MAX_TRAILER_SIZE, | |
417 | FailureMode.STREAM_RESET); | |
409 | 418 | } |
410 | 419 | |
411 | 420 | |
412 | 421 | @Test |
413 | 422 | public void doTestPostWithTrailerHeadersSize0() throws Exception{ |
414 | doTestPostWithTrailerHeaders(Constants.DEFAULT_MAX_TRAILER_COUNT, 0, false); | |
415 | } | |
416 | ||
417 | ||
418 | private void doTestPostWithTrailerHeaders(int maxTrailerCount, int maxTrailerSize, boolean ok) | |
419 | throws Exception { | |
423 | doTestPostWithTrailerHeaders(Constants.DEFAULT_MAX_TRAILER_COUNT, 0, | |
424 | FailureMode.CONNECTION_RESET); | |
425 | } | |
426 | ||
427 | ||
428 | private void doTestPostWithTrailerHeaders(int maxTrailerCount, int maxTrailerSize, | |
429 | FailureMode failMode) throws Exception { | |
420 | 430 | enableHttp2(); |
421 | 431 | |
422 | 432 | Http2Protocol http2Protocol = |
448 | 458 | // Trailers |
449 | 459 | writeFrame(trailerFrameHeader, trailerPayload); |
450 | 460 | |
451 | parser.readFrame(true); | |
452 | if (ok) { | |
461 | switch (failMode) { | |
462 | case NONE: { | |
463 | parser.readFrame(true); | |
453 | 464 | parser.readFrame(true); |
454 | 465 | parser.readFrame(true); |
455 | 466 | parser.readFrame(true); |
467 | 478 | "\n" + |
468 | 479 | "3-EndOfStream\n", |
469 | 480 | output.getTrace()); |
470 | } else { | |
481 | break; | |
482 | } | |
483 | case STREAM_RESET: { | |
484 | parser.readFrame(true); | |
471 | 485 | Assert.assertEquals("3-RST-[11]\n", output.getTrace()); |
486 | break; | |
487 | } | |
488 | case CONNECTION_RESET: { | |
489 | // Connection reset | |
490 | do { | |
491 | // NIO2 can sometimes send window updates depending on the | |
492 | // timing of the connection close | |
493 | output.clearTrace(); | |
494 | parser.readFrame(true); | |
495 | } while (output.getTrace().contains("WindowSize")); | |
496 | ||
497 | // Connection ID will vary so use a pattern | |
498 | Assert.assertThat(output.getTrace(), RegexMatcher.matchesRegex( | |
499 | "0-Goaway-\\[3\\]-\\[11\\]-\\[Connection \\[\\d++\\], Stream \\[3\\], .*")); | |
500 | break; | |
501 | } | |
502 | } | |
503 | } | |
504 | ||
505 | ||
506 | private enum FailureMode { | |
507 | NONE, | |
508 | STREAM_RESET, | |
509 | CONNECTION_RESET, | |
510 | ||
511 | } | |
512 | ||
513 | ||
514 | private static class RegexMatcher extends TypeSafeMatcher<String> { | |
515 | ||
516 | private final String pattern; | |
517 | ||
518 | ||
519 | public RegexMatcher(String pattern) { | |
520 | this.pattern = pattern; | |
521 | } | |
522 | ||
523 | ||
524 | @Override | |
525 | public void describeTo(Description description) { | |
526 | description.appendText("match to regular expression pattern [" + pattern + "]"); | |
527 | ||
528 | } | |
529 | ||
530 | @Override | |
531 | protected boolean matchesSafely(String item) { | |
532 | return item.matches(pattern); | |
533 | } | |
534 | ||
535 | ||
536 | public static RegexMatcher matchesRegex(String pattern) { | |
537 | return new RegexMatcher(pattern); | |
472 | 538 | } |
473 | 539 | } |
474 | 540 | } |
54 | 54 | |
55 | 55 | os.write(settings); |
56 | 56 | |
57 | // Read GOAWAY frame | |
58 | parser.readFrame(true); | |
59 | ||
60 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
61 | "0-Goaway-[1]-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]-[")); | |
57 | handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR); | |
62 | 58 | } |
63 | 59 | |
64 | 60 | @Test |
80 | 76 | |
81 | 77 | os.write(ping); |
82 | 78 | |
83 | // Read GOAWAY frame | |
84 | parser.readFrame(true); | |
85 | ||
86 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
87 | "0-Goaway-[1]-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]-[")); | |
79 | handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR); | |
88 | 80 | } |
89 | 81 | |
90 | 82 | |
106 | 98 | |
107 | 99 | os.write(ping); |
108 | 100 | |
109 | // Read GOAWAY frame | |
110 | parser.readFrame(true); | |
111 | ||
112 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
113 | "0-Goaway-[1]-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]-[")); | |
101 | handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR); | |
114 | 102 | } |
115 | 103 | |
116 | 104 | |
133 | 121 | |
134 | 122 | os.write(priority); |
135 | 123 | |
136 | // Read GOAWAY frame | |
124 | // Read Stream reset frame | |
137 | 125 | parser.readFrame(true); |
138 | 126 | |
139 | 127 | Assert.assertTrue(output.getTrace(), |
45 | 45 | // Process the request |
46 | 46 | writeFrame(frameHeader, headersPayload); |
47 | 47 | |
48 | // Read GOAWAY frame | |
49 | parser.readFrame(true); | |
50 | ||
51 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
52 | "0-Goaway-[1]-[" + Http2Error.COMPRESSION_ERROR.getCode() + "]-[")); | |
48 | handleGoAwayResponse(1, Http2Error.COMPRESSION_ERROR); | |
53 | 49 | } |
54 | 50 | |
55 | 51 | |
90 | 86 | |
91 | 87 | sendPing(); |
92 | 88 | |
93 | // Read GOAWAY frame | |
94 | parser.readFrame(true); | |
95 | ||
96 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
97 | "0-Goaway-[1]-[" + Http2Error.COMPRESSION_ERROR.getCode() + "]-[")); | |
89 | handleGoAwayResponse(1, Http2Error.COMPRESSION_ERROR); | |
98 | 90 | } |
99 | 91 | } |
35 | 35 | |
36 | 36 | sendWindowUpdate(3, 200); |
37 | 37 | |
38 | parser.readFrame(true); | |
39 | ||
40 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
41 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
38 | handleGoAwayResponse(1); | |
42 | 39 | } |
43 | 40 | |
44 | 41 | |
48 | 45 | |
49 | 46 | sendData(3, new byte[] {}); |
50 | 47 | |
51 | parser.readFrame(true); | |
52 | ||
53 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
54 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
48 | handleGoAwayResponse(1); | |
55 | 49 | } |
56 | 50 | |
57 | 51 | |
69 | 63 | Assert.assertEquals(getSimpleResponseTrace(3), output.getTrace()); |
70 | 64 | output.clearTrace(); |
71 | 65 | |
72 | // This should trigger a stream error | |
66 | // This should trigger a connection error | |
73 | 67 | sendData(3, new byte[] {}); |
74 | parser.readFrame(true); | |
75 | ||
76 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
77 | "0-Goaway-[3]-[" + Http2Error.STREAM_CLOSED.getCode() + "]-[")); | |
68 | ||
69 | handleGoAwayResponse(3, Http2Error.STREAM_CLOSED); | |
78 | 70 | } |
79 | 71 | |
80 | 72 | |
110 | 102 | public void testClosedInvalidFrame02() throws Exception { |
111 | 103 | http2Connect(); |
112 | 104 | |
113 | // Stream 1 is closed. This should trigger a stream error | |
105 | // Stream 1 is closed. This should trigger a connection error | |
114 | 106 | sendData(1, new byte[] {}); |
115 | parser.readFrame(true); | |
116 | ||
117 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
118 | "0-Goaway-[1]-[" + Http2Error.STREAM_CLOSED.getCode() + "]-[")); | |
107 | ||
108 | handleGoAwayResponse(1, Http2Error.STREAM_CLOSED); | |
119 | 109 | } |
120 | 110 | |
121 | 111 | |
134 | 124 | buildSimpleGetRequestPart1(frameHeader, headersPayload, 4); |
135 | 125 | writeFrame(frameHeader, headersPayload); |
136 | 126 | |
137 | // headers | |
138 | parser.readFrame(true); | |
139 | ||
140 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
141 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
127 | handleGoAwayResponse(1); | |
142 | 128 | } |
143 | 129 | |
144 | 130 | |
159 | 145 | os.write(frameHeader); |
160 | 146 | os.flush(); |
161 | 147 | |
162 | // headers | |
163 | parser.readFrame(true); | |
164 | ||
165 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
166 | "0-Goaway-[5]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
148 | handleGoAwayResponse(5); | |
167 | 149 | } |
168 | 150 | |
169 | 151 | |
183 | 165 | // closed. |
184 | 166 | sendSimpleGetRequest(3); |
185 | 167 | |
186 | parser.readFrame(true); | |
187 | ||
188 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
189 | "0-Goaway-[5]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
168 | handleGoAwayResponse(5); | |
190 | 169 | } |
191 | 170 | |
192 | 171 |
90 | 90 | os.write(UNKNOWN_FRAME); |
91 | 91 | os.flush(); |
92 | 92 | |
93 | // Read GOAWAY frame | |
94 | parser.readFrame(true); | |
95 | ||
96 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
97 | "0-Goaway-[1]-[" + Http2Error.COMPRESSION_ERROR.getCode() + "]-[")); | |
93 | handleGoAwayResponse(1, Http2Error.COMPRESSION_ERROR); | |
98 | 94 | } |
99 | ||
100 | 95 | } |
111 | 111 | os.write(dataFrame); |
112 | 112 | os.flush(); |
113 | 113 | |
114 | parser.readFrame(true); | |
115 | ||
116 | String trace = output.getTrace(); | |
117 | Assert.assertTrue(trace, trace.startsWith("0-Goaway-[1]-[1]-[")); | |
114 | handleGoAwayResponse(1); | |
118 | 115 | } |
119 | 116 | |
120 | 117 | |
138 | 135 | os.write(dataFrame); |
139 | 136 | os.flush(); |
140 | 137 | |
141 | parser.readFrame(true); | |
142 | ||
143 | String trace = output.getTrace(); | |
144 | Assert.assertTrue(trace, trace.startsWith("0-Goaway-[1]-[1]-[")); | |
138 | handleGoAwayResponse(1); | |
145 | 139 | } |
146 | 140 | |
147 | 141 |
40 | 40 | buildSimpleGetRequestPart1(frameHeader, headersPayload, 0); |
41 | 41 | writeFrame(frameHeader, headersPayload); |
42 | 42 | |
43 | // Go away | |
44 | parser.readFrame(true); | |
45 | ||
46 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
47 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
43 | handleGoAwayResponse(1); | |
48 | 44 | } |
49 | 45 | |
50 | 46 | |
69 | 65 | |
70 | 66 | sendSimpleGetRequest(3, padding); |
71 | 67 | |
72 | // Goaway | |
73 | parser.readFrame(true); | |
74 | ||
75 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
76 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
68 | handleGoAwayResponse(1); | |
77 | 69 | } |
78 | 70 | |
79 | 71 | |
97 | 89 | os.write(headerFrame); |
98 | 90 | os.flush(); |
99 | 91 | |
100 | parser.readFrame(true); | |
101 | ||
102 | String trace = output.getTrace(); | |
103 | Assert.assertTrue(trace, trace.startsWith("0-Goaway-[1]-[1]-[")); | |
92 | handleGoAwayResponse(1); | |
104 | 93 | } |
105 | 94 | |
106 | 95 |
36 | 36 | |
37 | 37 | sendPriority(0, 1, 15); |
38 | 38 | |
39 | // Go away | |
40 | parser.readFrame(true); | |
41 | ||
42 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
43 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
39 | handleGoAwayResponse(1); | |
44 | 40 | } |
45 | 41 | |
46 | 42 | |
57 | 53 | |
58 | 54 | sendPriority(5, 3, 15); |
59 | 55 | |
60 | // Read GOAWAY frame | |
61 | parser.readFrame(true); | |
62 | ||
63 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
64 | "0-Goaway-[1]-[" + Http2Error.COMPRESSION_ERROR.getCode() + "]-[")); | |
56 | handleGoAwayResponse(1, Http2Error.COMPRESSION_ERROR); | |
65 | 57 | } |
66 | 58 | |
67 | 59 | |
84 | 76 | os.write(priorityFrame); |
85 | 77 | os.flush(); |
86 | 78 | |
87 | // Read GOAWAY frame | |
79 | // Read reset frame | |
88 | 80 | parser.readFrame(true); |
89 | 81 | |
90 | 82 | Assert.assertEquals("3-RST-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]\n", |
34 | 34 | |
35 | 35 | sendRst(0, Http2Error.NO_ERROR.getCode()); |
36 | 36 | |
37 | // Go away | |
38 | parser.readFrame(true); | |
39 | ||
40 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
41 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
37 | handleGoAwayResponse(1); | |
42 | 38 | } |
43 | 39 | |
44 | 40 | |
50 | 46 | sendPriority(3, 0, 15); |
51 | 47 | sendRst(3, Http2Error.NO_ERROR.getCode()); |
52 | 48 | |
53 | // Go away | |
54 | parser.readFrame(true); | |
55 | ||
56 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
57 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
49 | handleGoAwayResponse(1); | |
58 | 50 | } |
59 | 51 | |
60 | 52 | |
77 | 69 | os.write(resetFrame); |
78 | 70 | os.flush(); |
79 | 71 | |
80 | // Read GOAWAY frame | |
72 | // Read reset frame | |
81 | 73 | parser.readFrame(true); |
82 | 74 | |
83 | 75 | Assert.assertEquals("3-RST-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]\n", |
35 | 35 | |
36 | 36 | sendSettings(0, true, new SettingValue(1,1)); |
37 | 37 | |
38 | // Go away | |
39 | parser.readFrame(true); | |
40 | ||
41 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
42 | "0-Goaway-[1]-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]-[")); | |
38 | handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR); | |
43 | 39 | } |
44 | 40 | |
45 | 41 | |
51 | 47 | sendPriority(3, 0, 15); |
52 | 48 | sendSettings(3, true, new SettingValue(1,1)); |
53 | 49 | |
54 | // Go away | |
55 | parser.readFrame(true); | |
56 | ||
57 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
58 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
50 | handleGoAwayResponse(1); | |
59 | 51 | } |
60 | 52 | |
61 | 53 | |
77 | 69 | os.write(resetFrame); |
78 | 70 | os.flush(); |
79 | 71 | |
80 | // Read GOAWAY frame | |
81 | parser.readFrame(true); | |
82 | ||
83 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
84 | "0-Goaway-[1]-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]-[")); | |
72 | handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR); | |
85 | 73 | } |
86 | 74 | |
87 | 75 | |
94 | 82 | |
95 | 83 | sendSettings(0, false, new SettingValue(0x2,0x2)); |
96 | 84 | |
97 | // Go away | |
98 | parser.readFrame(true); | |
99 | ||
100 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
101 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
85 | handleGoAwayResponse(1); | |
102 | 86 | } |
103 | 87 | |
104 | 88 | |
109 | 93 | |
110 | 94 | sendSettings(0, false, new SettingValue(0x4,1 << 31)); |
111 | 95 | |
112 | // Go away | |
113 | parser.readFrame(true); | |
114 | ||
115 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
116 | "0-Goaway-[1]-[" + Http2Error.FLOW_CONTROL_ERROR.getCode() + "]-[")); | |
96 | handleGoAwayResponse(1, Http2Error.FLOW_CONTROL_ERROR); | |
117 | 97 | } |
118 | 98 | |
119 | 99 | |
124 | 104 | |
125 | 105 | sendSettings(0, false, new SettingValue(0x5,1 << 31)); |
126 | 106 | |
127 | // Go away | |
128 | parser.readFrame(true); | |
129 | ||
130 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
131 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
107 | handleGoAwayResponse(1); | |
132 | 108 | } |
133 | 109 | |
134 | 110 |
66 | 66 | |
67 | 67 | sendPing(1, false, "76543210".getBytes(StandardCharsets.ISO_8859_1)); |
68 | 68 | |
69 | // Go away | |
70 | parser.readFrame(true); | |
71 | ||
72 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
73 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
69 | handleGoAwayResponse(1); | |
74 | 70 | } |
75 | 71 | |
76 | 72 | |
81 | 77 | |
82 | 78 | sendPing(0, false, "6543210".getBytes(StandardCharsets.ISO_8859_1)); |
83 | 79 | |
84 | // Go away | |
85 | parser.readFrame(true); | |
86 | ||
87 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
88 | "0-Goaway-[1]-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]-[")); | |
80 | handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR); | |
89 | 81 | } |
90 | ||
91 | 82 | } |
90 | 90 | |
91 | 91 | sendGoaway(1, 1, Http2Error.NO_ERROR.getCode(), null); |
92 | 92 | |
93 | // Go away | |
94 | parser.readFrame(true); | |
95 | ||
96 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
97 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
93 | handleGoAwayResponse(1); | |
98 | 94 | } |
99 | 95 | |
100 | 96 |
35 | 35 | |
36 | 36 | sendWindowUpdate(0, 0); |
37 | 37 | |
38 | parser.readFrame(true); | |
39 | ||
40 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
41 | "0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-[")); | |
38 | handleGoAwayResponse(1); | |
42 | 39 | } |
43 | 40 | |
44 | 41 | |
88 | 85 | os.write(zeroLengthWindowFrame); |
89 | 86 | os.flush(); |
90 | 87 | |
91 | parser.readFrame(true); | |
92 | ||
93 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
94 | "0-Goaway-[1]-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "]-[")); | |
88 | handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR); | |
95 | 89 | } |
96 | 90 | |
97 | 91 | |
149 | 143 | // Super size the flow control window. |
150 | 144 | sendWindowUpdate(0, (1 << 31) - 1); |
151 | 145 | |
152 | parser.readFrame(true); | |
153 | ||
154 | Assert.assertTrue(output.getTrace(), output.getTrace().startsWith( | |
155 | "0-Goaway-[1]-[" + Http2Error.FLOW_CONTROL_ERROR.getCode() + "]-[")); | |
146 | handleGoAwayResponse(1, Http2Error.FLOW_CONTROL_ERROR); | |
156 | 147 | } |
157 | 148 | |
158 | 149 |
66 | 66 | |
67 | 67 | @After |
68 | 68 | public void tearDown() { |
69 | for (File file : logsDir.listFiles()) { | |
70 | file.delete(); | |
69 | File[] files = logsDir.listFiles(); | |
70 | if (files != null) { | |
71 | for (File file : files) { | |
72 | file.delete(); | |
73 | } | |
74 | logsDir.delete(); | |
71 | 75 | } |
72 | logsDir.delete(); | |
73 | 76 | } |
74 | 77 | |
75 | 78 | @SuppressWarnings("unused") |
77 | 80 | public void testCleanOnInitOneHandler() throws Exception { |
78 | 81 | generateLogFiles(logsDir, PREFIX_1, SUFIX_1, 3); |
79 | 82 | |
80 | FileHandler handler = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, 2); | |
83 | new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, 2); | |
81 | 84 | |
82 | 85 | Thread.sleep(1000); |
83 | 86 | |
89 | 92 | public void testCleanOnInitMultipleHandlers() throws Exception { |
90 | 93 | generateLogFiles(logsDir, PREFIX_1, SUFIX_1, 3); |
91 | 94 | |
92 | FileHandler handler1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, 2); | |
93 | FileHandler handler2 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_2, 2); | |
94 | FileHandler handler3 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_2, SUFIX_1, 2); | |
95 | FileHandler handler4 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_3, SUFIX_1, 2); | |
95 | new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, 2); | |
96 | new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_2, 2); | |
97 | new FileHandler(logsDir.getAbsolutePath(), PREFIX_2, SUFIX_1, 2); | |
98 | new FileHandler(logsDir.getAbsolutePath(), PREFIX_3, SUFIX_1, 2); | |
96 | 99 | |
97 | 100 | Thread.sleep(1000); |
98 | 101 | |
104 | 107 | public void testCleanDisabled() throws Exception { |
105 | 108 | generateLogFiles(logsDir, PREFIX_1, SUFIX_1, 3); |
106 | 109 | |
107 | FileHandler handler = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, -1); | |
110 | new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, -1); | |
108 | 111 | |
109 | 112 | Thread.sleep(1000); |
110 | 113 |
0 | /* | |
1 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | * contributor license agreements. See the NOTICE file distributed with | |
3 | * this work for additional information regarding copyright ownership. | |
4 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | * (the "License"); you may not use this file except in compliance with | |
6 | * the License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.apache.juli; | |
17 | ||
18 | import java.io.File; | |
19 | import java.net.URLDecoder; | |
20 | ||
21 | import static org.junit.Assert.assertTrue; | |
22 | ||
23 | import org.junit.After; | |
24 | import org.junit.BeforeClass; | |
25 | import org.junit.Test; | |
26 | ||
27 | import org.apache.catalina.startup.LoggingBaseTest; | |
28 | ||
29 | public class TestFileHandlerNonRotatable extends LoggingBaseTest { | |
30 | private FileHandler testHandler; | |
31 | ||
32 | @BeforeClass | |
33 | public static void setUpPerTestClass() throws Exception { | |
34 | System.setProperty("java.util.logging.manager", | |
35 | "org.apache.juli.ClassLoaderLogManager"); | |
36 | String configLoggingPath = TestFileHandlerNonRotatable.class | |
37 | .getResource("logging-non-rotatable.properties") | |
38 | .getFile(); | |
39 | System.setProperty("java.util.logging.config.file", | |
40 | URLDecoder.decode(configLoggingPath, java.nio.charset.StandardCharsets.UTF_8.toString())); | |
41 | } | |
42 | ||
43 | @Override | |
44 | @After | |
45 | public void tearDown() throws Exception { | |
46 | if (testHandler != null) { | |
47 | testHandler.close(); | |
48 | } | |
49 | super.tearDown(); | |
50 | } | |
51 | ||
52 | @Test | |
53 | public void testBug61232() throws Exception { | |
54 | testHandler = new FileHandler(this.getTemporaryDirectory().toString(), | |
55 | "juli.", ".log"); | |
56 | ||
57 | File logFile = new File(this.getTemporaryDirectory(), "juli.log"); | |
58 | assertTrue(logFile.exists()); | |
59 | } | |
60 | ||
61 | @Test | |
62 | public void testCustomSuffixWithoutSeparator() throws Exception { | |
63 | testHandler = new FileHandler(this.getTemporaryDirectory().toString(), | |
64 | "juli.", "log"); | |
65 | ||
66 | File logFile = new File(this.getTemporaryDirectory(), "juli.log"); | |
67 | assertTrue(logFile.exists()); | |
68 | } | |
69 | ||
70 | @Test | |
71 | public void testCustomPrefixWithoutSeparator() throws Exception { | |
72 | testHandler = new FileHandler(this.getTemporaryDirectory().toString(), | |
73 | "juli", ".log"); | |
74 | ||
75 | File logFile = new File(this.getTemporaryDirectory(), "juli.log"); | |
76 | assertTrue(logFile.exists()); | |
77 | } | |
78 | }⏎ |
0 | # Licensed to the Apache Software Foundation (ASF) under one or more | |
1 | # contributor license agreements. See the NOTICE file distributed with | |
2 | # this work for additional information regarding copyright ownership. | |
3 | # The ASF licenses this file to You under the Apache License, Version 2.0 | |
4 | # (the "License"); you may not use this file except in compliance with | |
5 | # the License. You may obtain a copy of the License at | |
6 | # | |
7 | # http://www.apache.org/licenses/LICENSE-2.0 | |
8 | # | |
9 | # Unless required by applicable law or agreed to in writing, software | |
10 | # distributed under the License is distributed on an "AS IS" BASIS, | |
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | # See the License for the specific language governing permissions and | |
13 | # limitations under the License. | |
14 | ||
15 | org.apache.juli.FileHandler.rotatable = false⏎ |
0 | It is 404.html⏎ |
43 | 43 | They eventually become mixed with the numbered issues. (I.e., numbered |
44 | 44 | issues do not "pop up" wrt. others). |
45 | 45 | --> |
46 | <section name="Tomcat 8.5.17 (markt)"> | |
46 | <section name="Tomcat 8.5.18 (markt)"> | |
47 | <subsection name="Catalina"> | |
48 | <changelog> | |
49 | <fix> | |
50 | <bug>61232</bug>: When log rotation is disabled only one separator will | |
51 | be used when generating the log file name. For example if the prefix is | |
52 | <code>catalina.</code> and the suffix is <code>.log</code> then the log | |
53 | file name will be <code>catalina.log</code> instead of | |
54 | <code>catalina..log</code>. Patch provided by Katya Stoycheva. | |
55 | (violetagg) | |
56 | </fix> | |
57 | <fix> | |
58 | <bug>61264</bug>: Correct a regression in the refactoring to use | |
59 | <code>Charset</code> rather than <code>String</code> to store request | |
60 | character encoding that prevented <code>getReader()</code> throwing an | |
61 | <code>UnsupportedEncodingException</code> if the user agent specifies | |
62 | an unsupported character encoding. (markt) | |
63 | </fix> | |
64 | <fix> | |
65 | Correct a regression in the fix for <bug>49464</bug> that could cause an | |
66 | incorrect <code>Content-Length</code> header to be sent by the | |
67 | <code>DefaultServlet</code> if the encoding of a static is not | |
68 | consistent with the encoding of the response. (markt) | |
69 | </fix> | |
70 | </changelog> | |
71 | </subsection> | |
72 | <subsection name="Coyote"> | |
73 | <changelog> | |
74 | <fix> | |
75 | Enable TLS connectors to use Java key stores that contain multiple keys | |
76 | where each key has a separate password. Based on a patch by Frank | |
77 | Taffelt. (markt) | |
78 | </fix> | |
79 | <fix> | |
80 | Improve the handling of HTTP/2 stream resets due to excessive headers | |
81 | when a continuation frame is used. (markt) | |
82 | </fix> | |
83 | </changelog> | |
84 | </subsection> | |
85 | <subsection name="Jasper"> | |
86 | <changelog> | |
87 | <add> | |
88 | <bug>53031</bug>: Add support for the <code>fork</code> option when | |
89 | compiling JSPs with the Jasper Ant task and javac. (markt) | |
90 | </add> | |
91 | </changelog> | |
92 | </subsection> | |
93 | <subsection name="Other"> | |
94 | <changelog> | |
95 | <add> | |
96 | <bug>52791</bug>: Add the ability to set the defaults used by the | |
97 | Windows installer from a configuration file. Patch provided by Sandra | |
98 | Madden. (markt) | |
99 | </add> | |
100 | </changelog> | |
101 | </subsection> | |
102 | </section> | |
103 | <section name="Tomcat 8.5.17 (markt)" rtext="not released"> | |
47 | 104 | <subsection name="Catalina"> |
48 | 105 | <changelog> |
49 | 106 | <fix> |
60 | 60 | <p> |
61 | 61 | In addition to dynamic discovery, Apache Tribes also supports static membership, with membership verification. |
62 | 62 | To achieve this add the <code>org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor</code> |
63 | underneath the <code>org.apache.catalina.tribes.group.interceptors.TcpFailureDetector</code> interceptor. | |
63 | after the <code>org.apache.catalina.tribes.group.interceptors.TcpFailureDetector</code> interceptor. | |
64 | 64 | Inside the <code>StaticMembershipInterceptor</code> you can add the static members you wish to have. |
65 | 65 | The <code>TcpFailureDetector</code> will do a health check on the static members,and also monitor them for crashes |
66 | 66 | so they will have the same level of notification mechanism as the members that are automatically discovered.</p> |
70 | 70 | will not be any tray icon present when Tomcat is running. Note that |
71 | 71 | when choosing to run Tomcat at the end of installation, the tray |
72 | 72 | icon will be used even if Tomcat was installed as a service.</li> |
73 | <li><strong>Defaults</strong>: The defaults used by the installer may be | |
74 | overridden by use of the <code>/C=<config file></code> command | |
75 | line argument. The configuration file uses the format | |
76 | <code>name=value</code> with each pair on a separate line. The names | |
77 | of the available configuration options are: | |
78 | <ul> | |
79 | <li>JavaHome</li> | |
80 | <li>TomcatPortShutdown</li> | |
81 | <li>TomcatPortHttp</li> | |
82 | <li>TomcatPortAjp</li> | |
83 | <li>TomcatMenuEntriesEnable</li> | |
84 | <li>TomcatShortcutAllUsers</li> | |
85 | <li>TomcatServiceDefaultName</li> | |
86 | <li>TomcatServiceName</li> | |
87 | <li>TomcatServiceFileName</li> | |
88 | <li>TomcatServiceManagerFileName</li> | |
89 | <li>TomcatAdminEnable</li> | |
90 | <li>TomcatAdminUsername</li> | |
91 | <li>TomcatAdminPassword</li> | |
92 | <li>TomcatAdminRoles</li> | |
93 | </ul> | |
94 | By using <code>/C=...</code> along with <code>/S</code> and | |
95 | <code>/D=</code> it is possible to perform fully configured | |
96 | unattended installs of Apache Tomact. | |
97 | </li> | |
73 | 98 | <li>Refer to the |
74 | 99 | <a href="windows-service-howto.html">Windows Service HOW-TO</a> |
75 | 100 | for information on how to manage Tomcat as a Windows service. |
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | ||
14 | 15 | helloworld.title = Hola Mundo! |
15 | 16 | requestinfo.title = Ejemplo de Informacion de Requerimiento: |
16 | 17 | requestinfo.label.method = M\u00E9todo: |